Right Triangles Leetcode Problem