1 should be an acceptable answer to n=3 as there a single way to triangulate a triangle - do not do anything. I don't get why you chose not to consider this.
Python.
I think it's important to say that n is the number of vertices the polygon has.
If the above is true, then the phrasing 'For n=2, possible_triangulations(2) returns 2,' Doesn't make any sense. To return 2, n should be 4; and when n = 2, it should return 'Not a valid polygon'.
1 should be an acceptable answer to n=3 as there a single way to triangulate a triangle - do not do anything. I don't get why you chose not to consider this.
Python.
I think it's important to say that n is the number of vertices the polygon has.
If the above is true, then the phrasing 'For n=2, possible_triangulations(2) returns 2,' Doesn't make any sense. To return 2, n should be 4; and when n = 2, it should return 'Not a valid polygon'.
JS Test Case: Missing describe blocks.
Python new test framework should be used (Refer this for more detail)
No random tests.
This comment is hidden because it contains spoiler information about the solution
10 random tests are not enough, considering that it's very unlikely to have tests at the lower range (
1 <= n <= 100
) except the three fixed tests.Description is inconsistent with fixed tests:
but
Also, returning mixed data type is a bad practice.