C++ Solution to Leetcode 120. Triangle