Improved performance but gets some wrong answers on certain test cases.
Merge branch 'master' of https://github.com/nadyac/Some-Problems-I-Solved-Just-Because