728x90
반응형
문제
- https://www.hackerrank.com/challenges/what-type-of-triangle/problem?h_r=internal-search
- 요약하면 A,B,C 세 길이가 주어지고, A,B,C 를 각각 판단해서 이름을 alias 붙여주면 됨.
풀이
select
case
when (A + B <= C) OR (B+C <= A) OR (C+A <= B) then 'Not A Triangle'
when A=B and B=C then 'Equilateral'
when (A=B and B!=C) OR (B=C and C!=A) OR (C=A and A!=B) then 'Isosceles'
when A!=B and B!=C and C != A then 'Scalene'
end
from
TRIANGLES
;
'algorithm > hackerRank' 카테고리의 다른 글
Hackerrank The Grid Search 풀이 (0) | 2020.10.07 |
---|---|
hackerrank Top Earners 풀이 (0) | 2020.09.23 |
hackerrank Non-Divisible Subset 풀이 (0) | 2020.09.21 |
hackerrank the-time-in-words 풀이 (0) | 2020.09.18 |
Hackerrank Bigger is greater (0) | 2020.09.14 |
댓글