Count Possible Triangles Leetcode Javascript Interview