Some exercises taken from http://adriann.github.io/programming_problems.html