Last active
June 26, 2022 19:28
-
-
Save smrfeld/838af465a4db5589feb9a63319c5e02b to your computer and use it in GitHub Desktop.
Skeleton for simplified Pythagorean triplet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var soln = new List<(int a, int b, int c)>(); | |
// Bound for a | |
// NOTE: this is a first guess, we'll do better later | |
// a + b + c = N => If all are equal, upper bound is N/3 | |
double aMax = n / 3.0; | |
for (int a=1; a<aMax; a++) | |
{ | |
// Find b,c ... | |
soln.Add((a, b, c)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment