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.
if "Case1: A + B > C AND A+C>B AND B+C>A" is true then only after that you have to verify "case2: A != B OR B != C OR A != C" which kind of triangle it is. If it is not a valid triangle, case1 will be false and you don't have to worry about the rest cases.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Type of Triangle
You are viewing a single comment's thread. Return to all comments →
if "Case1: A + B > C AND A+C>B AND B+C>A" is true then only after that you have to verify "case2: A != B OR B != C OR A != C" which kind of triangle it is. If it is not a valid triangle, case1 will be false and you don't have to worry about the rest cases.