If you like number theory, combinatorics, and/or optimizing Haskell code, I challenge you to solve Infinite 2D Array using Haskell.
- Level 1: can you come up with a general formula to compute ?
- Level 2: In general, how can you efficiently compute ?
- Level 3: Now implement the above ideas in Haskell so your solution actually fits within the 1 second time limit.
I have solved it but it was definitely challenging. In a subsequent blog post I’ll talk about my solution and ask for other optimization ideas.