๐ข ๋ณธ ํฌ์คํ ์ ํ์ฉ๋๋ ๊ธฐ๋ณธ ๋ฌธ์ ๋ฐ ์๋ฃ ์ถ์ฒ๋
๋ฆฌํธ์ฝ๋ Problems, https://leetcode.com/problemset/all/์์ ๋ฐํ๋๋ค.
โ๋ฌธ์
https://leetcode.com/problems/triangle-judgement/description/
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Table : Triangle
Report for every three line segments whether they can form a triangle.
Return the result table in any order.
The result format is in the following example.
โ ํ์ด
๋ฌธ์ ์๊ตฌ์ฌํญ
์ผ๊ฐํ ํ์ฑ ์กฐ๊ฑด์ ์์๋ณด๋ฉด,
'๊ฐ์ฅ ๊ธด ๋ณ์ ๊ธธ์ด๊ฐ ๋๋จธ์ง ๋ ๋ณ์ ๊ธธ์ด์ ํฉ๋ณด๋ค ์์์ผ ํ๋ค.'
์ด๊ฒ์ ์ฟผ๋ฆฌ๋ก ์์ฑํด์ค์ผํ๋๋ฐ ์ธ ๋ณ์ธ x, y, z ์ค ์ต๋ ๊ธธ์ด๋ฅผ ๊ฐ๋ ๋ณ์ด ์ด๋ค ์ปฌ๋ผ์ธ์ง ๋ชจ๋ฅด๊ธฐ ๋๋ฌธ์AND์กฐ๊ฑด์ ์ฌ์ฉํด์ ๊ฒฝ์ฐ์ ์๋ฅผ ๋ชจ๋ ์กฐ๊ฑด์ผ๋ก ์จ์คฌ๋ค.
SELECT x, y, z,
CASE WHEN (x+y > z AND y+z > x AND z+x > y) THEN 'Yes' ELSE 'No' END AS triangle
FROM Triangle
'Growth ๐ณ > Practice ๐ป' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Leet code] 1174. Immediate Food Delivery II (0) | 2023.09.15 |
---|---|
[Leet code] 1141. User Activity for the Past 30 Days IEasy474634 (0) | 2023.09.13 |
[Leet code] 1050. Actors and Directors Who Cooperated At Least Three Times (2) | 2023.09.08 |
[Leet code] 619. Biggest Single Number (0) | 2023.09.02 |
[Leet code] 1173. Immediate Food Delivery I (0) | 2023.08.03 |