-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem 9 [Language] #17
Comments
Hi Jamie, Indeed a fun problem to tackle ! As for the problem statement; indeed: it seems I forgot to add the last sentence to the problem description which is: Find the product abc Sorry for that ;-) Of course, in case of doubt, there’s always the source at https://projecteuler.net/problems https://projecteuler.net/problems. Regards, Eric
|
Jamie, By the way; a related problem to this one is:
It’s not in the set of problems include in the repo. You may want to have a crack at it. The core stuff you need is already there. If you’d like to have it in included in the repo, let me know and I’ll add it. Cheers, Eric
|
And this is just using brute-force, without Erics tip: (for {
a <- 1 to 999
b <- a to 999
c <- b to 999 filter (c1 => a + b + c1 == 1000 && a*a + b*b == c1*c1)
} yield (a * b * c)).head A triple for-comprehension with the condition as a filter on the third. |
very nice, Michel! On Fri, Jan 9, 2015 at 11:00 AM, Verbist Michel notifications@github.com
__~O reality goes far beyond imagination |
Hi Guys
Really had fun with Problem 9
One suggestion though - It would be nice to know the format in which the answer should be given e.g. i had to infer from the answer of @LucDupAtGitHub that the product of all three was required. i had the correct solution but was not sure of the format of the answer. This is not a criticism just a remark ;-)
The text was updated successfully, but these errors were encountered: