|
|
Orchid XP v7 wrote:
> (E.g., problem 1, I wrote something that loops over the numbers 1 to 100
> finding those that fit the divisibility requirements and summing them.
> Somebody else managed to produce a closed-form *formula* for the answer.
> Beat that!)
Not particularly hard. You have a formula for the sum of all integers
from 1 to 100. And one for the sum of all multiples of 3 till 100. Ditto
for multiples of 5. Now just subtract the sum of all multiples of 15.
> The few Haskell solutions I've seen look unecessarily wordy - like they
> were written by somebody just learning Haskell. But then, the Haskell
> Wiki has a section devoted to Project Euler, and most solutions there
> look rather childish and unperformant too, so...
I do stuff in Python. Even though some manage to solve whole problems
with one line solutions, it is generally frowned upon in the Python
community if it gets challenging to read: They generally perform about
the same as more readable code.
So perhaps those Haskell users were converts from Python...
--
Diplomacy - the art of letting someone have your way.
/\ /\ /\ /
/ \/ \ u e e n / \/ a w a z
>>>>>>mue### [at] nawazorg<<<<<<
anl
Post a reply to this message
|
|