Published: 28 Apr 2024 › Updated: 28 Apr 2024

Custom Set
private final int a;
private final int b;
private final int c;
private PythagoreanTriplet() {
this.a = 0;
this.b = 0;
this.c = 0;
}
public PythagoreanTriplet(int a, int b, int c) {
this.a = a;
this.b = b;
this.c = c;
}
public static PythagoreanTripletListBuilder makeTripletsList() {
return new PythagoreanTriplet().createBuilder();
}
private PythagoreanTripletListBuilder createBuilder() {
return new PythagoreanTripletListBuilder();
}
public class PythagoreanTripletListBuilder {
private final List < PythagoreanTriplet > triplets = new ArrayList < > ();
private int limit = 0;
private int sum = 0;
public PythagoreanTripletListBuilder withFactorsLessThanOrEqualTo(int limit) {
this.limit = limit;
return this;
}
Leave Custom Set to:
Read more #ita posts
Best Posts From Alessandra
We have not curated any of drago18121996's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.