Tipos de triângulos – HackerRank

Solução para o problema “Type of triangle” do HackerRank. Mal otimizado, então não atingi nenhum score no Hacker Rank, famoso brute force solving.

Solução com SQL:

select case
         when a+b <= c || a+c <= b || b+c <= a then 'Not A Triangle'
         when a = b && a = c && b = c then 'Equilateral'
         when (a = b && b<>c) || (b = c && a <> b) || (c=a && a<>b) then 'Isosceles'
         else 'Scalene'
         end
from triangles;