Solved 38 problems and forgot my password after a short pause, haven't been able to log in for years :(
Project Euler
11–20 of 172 posts
Re: Project Euler
#12I really like to use project euler when I want to learn a new language. Exercises are sorted more or less by difficulty, at least for the first 50-100, and are completely langage agnostic (you just need to answer a question in a text input). It's also very good to learn algorithm and maths. Some problems can even be solved without any programming. And for some, a certain amount of math is necessary to have a efficien…
Re: Project Euler
#13Ah, memories. Back in 2010 I whinged to colleagues who were using their fancy functional languages to solve problem 1 inefficiently in 2 lines of code... " Project Euler problem 1 :- It helps to know the sum of (1 .. x) is 0.5 * n * (n+1). Multiples of 3 less than 1000 are (3 .. 999) == (1 .. 333) * 3 = 0.5 * 333 * 334 * 3 = 166833 Multiples of 5 less than 1000 are (5 .. 995) == (1 .. 199) * 5 = 0.5 * 199 * 200 * 5 =…
The best point to be made from this isn't that it's more computationally efficient. It's that, compared to something like sum [x | x which is really just bluntly translating the question into a programming language and letting it take care of the rest, your approach involves some actual insight into the underlying math.
Re: Project Euler
#14Earlier quoted context omitted.
The best point to be made from this isn't that it's more computationally efficient. It's that, compared to something like sum [x | x which is really just bluntly translating the question into a programming language and letting it take care of the rest, your approach involves some actual insight into the underlying math.
What language is this?
Re: Project Euler
#15Earlier quoted context omitted.
The best point to be made from this isn't that it's more computationally efficient. It's that, compared to something like sum [x | x which is really just bluntly translating the question into a programming language and letting it take care of the rest, your approach involves some actual insight into the underlying math.
What language is this?
Re: Project Euler
#16Earlier quoted context omitted.
The best point to be made from this isn't that it's more computationally efficient. It's that, compared to something like sum [x | x which is really just bluntly translating the question into a programming language and letting it take care of the rest, your approach involves some actual insight into the underlying math.
What language is this?
The sum of x for x from one to 999 where x mod three is zero or x mod five is zero.
well, the bit in square brackets is a comprehension. `sum `is just ordinary function application.
Re: Project Euler
#17Earlier quoted context omitted.
The best point to be made from this isn't that it's more computationally efficient. It's that, compared to something like sum [x | x which is really just bluntly translating the question into a programming language and letting it take care of the rest, your approach involves some actual insight into the underlying math.
What language is this?
Re: Project Euler
#18Re: Project Euler
#19I really like to use project euler when I want to learn a new language. Exercises are sorted more or less by difficulty, at least for the first 50-100, and are completely langage agnostic (you just need to answer a question in a text input). It's also very good to learn algorithm and maths. Some problems can even be solved without any programming. And for some, a certain amount of math is necessary to have a efficien…
But nice job translating them :-)
Re: Project Euler
#20Solutions here: https://github.com/luckytoilet/projecteuler-solutions
I learned so much solving problem XXX so is it okay to publish my solution elsewhere?
It appears that you have answered your own question. There is nothing quite like that "Aha!" moment when you finally beat a problem which you have been working on for some time. It is often through the best of intentions in wishing to share our insights so that others can enjoy that moment too. Sadly, however, that will not be the case for your readers. Real learning is an active process and seeing how it is done is a long way from experiencing that epiphany of discovery. Please do not deny others what you have so richly valued yourself.