LeetCode one time in C++