solution for assignment 3
8 puzzle