C++ Solution to Leetcode 165. Compare Version Numbers