Leetcode Daily Challenge Problem 6 C