Leetcode Water Jug Problem Code