Move puzzle
Ruby solution