add solution to problem 10. Lessions learned: 1. be careful when using
takeWhile or similar, it causes a lot of memory consumption, hence slower.
If you just want to iterator through collections and do that a lot of
times, use while. Maybe there will be some more functional ways to do
that, that's the problem for future me.
2. Integer overflow. It always happens.