C++ Solution to Leetcode 605. Can Place Flowers