LeetCode solutions in C++ template