We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Isosceles Triangles
Isosceles Triangles
Sort by
recency
|
6 Discussions
|
Please Login in order to post a comment
(1) Compute the number of isosceles triangles if all vertices are the same. (Note the differences when n is even, odd or a multiple of 3.)
(2) Subtract the no. of triangles formed by mismatched vertices. Start by dividing and counting the "1"/"0" vertices that can be paired.
Note: An isoceles triangle is determined by either 2 vertices, or 1 vertex and a side's length. Be aware of double counting.
test 0 is success but test 1 fail I think admin test is wrong because when I try the test1 data in the custom test, it is successful and the result is different from the test1 result.
What time complexity is required for this problem to pass the test case. My solution of O(N^2) is terminating due to timeout in test case 1. It is returning corret results in all cases but I got 0.
Can someone please help with the R code for the problem?
Upss, it is the case 4. Thank you.