Leetcode Problem 233