Count Possible Triangles Leetcode Python