Skip to content

Commit 5695251

Browse files
committed
Upload 193
1 parent dbf9bbe commit 5695251

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- markdownlint-disable MD041 -->
22
[![eevveerryyddaayy release](https://img.shields.io/badge/eevveerryyddaayy-v1.3.0-blue.svg)](https://github.com/ggeerraarrdd/eevveerryyddaayy/)
3-
[![Solved](https://img.shields.io/badge/solved-192-green.svg)](#index)
3+
[![Solved](https://img.shields.io/badge/solved-193-green.svg)](#index)
44
<!-- markdownlint-enable MD041 -->
55

66
# SQL Everyday
@@ -226,6 +226,7 @@ Because this project necessitated a framework to enable consistent daily practic
226226
| 190 | [Warehouse Manager](https://leetcode.com/problems/warehouse-manager/description/) | [Solution](solutions/190_warehouse_manager.md) | LeetCode | Easy | |
227227
| 191 | [The Number of Rich Customers](https://leetcode.com/problems/the-number-of-rich-customers/description/) | [Solution](solutions/191_the_number_of_rich_customers.md) | LeetCode | Easy | |
228228
| 192 | [Find Candidates for Data Scientist Position](https://leetcode.com/problems/find-candidates-for-data-scientist-position/description/) | [Solution](solutions/192_find_candidates_for_data_scientist_position.md) | LeetCode | Easy | |
229+
| 193 | [Classifying Triangles by Lengths](https://leetcode.com/problems/classifying-triangles-by-lengths/description/) | [Solution](solutions/193_classifying_triangles_by_lengths.md) | LeetCode | Easy | |
229230
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
230231
<!--- cSpell:enable --->
231232

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SQL Everyday \#193
2+
3+
## Classifying Triangles by Lengths
4+
5+
Site: LeetCode\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a query to find the type of **triangle**. Output one of the following for each row:
11+
12+
**Equilateral**: It's a triangle with 3 sides of equal length.
13+
**Isosceles**: It's a triangle with 2 sides of equal length.
14+
**Scalene**: It's a triangle with 3 sides of differing lengths.
15+
**Not A Triangle**: The given values of A, B, and C don't form a triangle.
16+
17+
Return the result table in **any order**. [[Full Description](https://leetcode.com/problems/classifying-triangles-by-lengths/description/)]
18+
19+
## Submitted Solution
20+
21+
```sql
22+
-- Submitted Solution
23+
SELECT
24+
CASE WHEN (A=B AND A=C) THEN 'Equilateral'
25+
WHEN (A+B<=C OR B+C<=A OR A+C<=B) THEN 'Not A Triangle'
26+
WHEN (A=B AND A!=C) OR (A=C AND A!=B) OR(B=C AND A!=C) THEN 'Isosceles'
27+
ELSE 'Scalene'
28+
END AS 'triangle_type'
29+
FROM Triangles
30+
;
31+
```
32+
33+
## Site Solution
34+
35+
```sql
36+
-- LeetCode Solution
37+
SELECT
38+
CASE WHEN (A=B AND A=C) THEN 'Equilateral'
39+
WHEN (A+B<=C OR B+C<=A OR A+C<=B) THEN 'Not A Triangle'
40+
WHEN (A=B AND A!=C) OR (A=C AND A!=B) OR(B=C AND A!=C) THEN 'Isosceles'
41+
ELSE 'Scalene'
42+
END AS 'triangle_type'
43+
FROM Triangles
44+
;
45+
```
46+
47+
## Notes
48+
49+
TBD
50+
51+
## NB
52+
53+
TBD
54+
55+
Go to [Index](../?tab=readme-ov-file#index)\
56+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)