Upgrade to Pro — share decks privately, control downloads, hide ads and more …

One way to solve the Problem 411 in Clojure – C...

One way to solve the Problem 411 in Clojure – Clj-Syd May 2013

During the first clj-syd hack night we all discussed possible approaches on solving the ProjectEuler problem 411 and we started solving it.

After few weeks I finally solved it and this is how I did it.

Filippo Vitale

May 02, 2013
Tweet

More Decks by Filippo Vitale

Other Decks in Programming

Transcript

  1. clj-syd pep-411 "It was nice to meet you at the

    first clj-syd hack night" aka "One way to solve the Problem 411 in Clojure"
  2. SortedMap of SortedSet Patience 5 [1 2 4 14 18]

    --> [1 2 4 6 18] --> [1 2 4 6 16]
  3. DS as a SortedSet Full Scale? k=30 --> n=305 -->

    24,300,000 Everything --> "mod n"
  4. Optimisations innermost loops "If a tree falls in a forest

    and no one is around to hear it, does it make a sound?"