Finished Polya's solution to water jugs puzzle