Leetcode Problem 2 Solution From 10 Solution