C++ implementation for LeetCode problems