c++ code for leetcode