You are viewing a single comment's thread. Return to all comments →
(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.
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Isosceles Triangles
You are viewing a single comment's thread. Return to all comments →
(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.