Implement non cheaty solution for problem 3
Add benchmark for problem 3