Q code to solve some interesting puzzles