Created
May 11, 2016 12:31
-
-
Save kei-q/d8a1a77a96b250f744e0afcbb0c09dce to your computer and use it in GitHub Desktop.
This file contains 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
let rightTriangles = { | |
(1...10).flatMap { c in | |
(1...c).flatMap { a in | |
(1...a).flatMap { b in | |
(a,b,c) | |
} | |
} | |
}.filter { (a,b,c) in | |
let b1 = a*a + b*b == c*c | |
let b2 = a+b+c == 24 | |
return b1 && b2 | |
} | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment