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.
check this out :
select
case
when a+b>c and a+c>b and b+c>a then
case
when (a=b and b!=c and a!=c ) or (b=c and a!=b and c!=a) or (a=c and b!=c and b!=c) then 'Isosceles'
when a!=b and b!=c and c!=a then 'Scalene'
when a=b and b=c and c=a then 'Equilateral'
end
else 'Not A Triangle'
end
from triangles;
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 →
check this out : select case when a+b>c and a+c>b and b+c>a then case when (a=b and b!=c and a!=c ) or (b=c and a!=b and c!=a) or (a=c and b!=c and b!=c) then 'Isosceles' when a!=b and b!=c and c!=a then 'Scalene' when a=b and b=c and c=a then 'Equilateral' end else 'Not A Triangle' end from triangles;