Leetcode Daily Challenge Problem 9 C