Skip to content

Commit 449f81c

Browse files
committed
May 19
1 parent 21171bf commit 449f81c

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

2025-05-May-LeetCoding-Challenge/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
| May 15 | [2900. Longest Unequal Adjacent Groups Subsequence I](https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-i/) | Easy | Solved |
2222
| May 16 | [2901. Longest Unequal Adjacent Groups Subsequence II](https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-ii/) | Medium | Unsolved |
2323
| May 17 | [75. Sort Colors](https://leetcode.com/problems/sort-colors/) | Medium | Solved |
24-
| May 18 | []() | | |
25-
| May 19 | []() | | |
24+
| May 18 | [1931. Painting a Grid With Three Different Colors](https://leetcode.com/problems/painting-a-grid-with-three-different-colors/) | Hard | Unsolved |
25+
| May 19 | [3024. Type of Triangle](https://leetcode.com/problems/type-of-triangle/) | Easy | Solved |
2626
| May 20 | []() | | |
2727
| May 21 | []() | | |
2828
| May 22 | []() | | |
@@ -40,6 +40,6 @@
4040
## Summary
4141
| Level | Problems | Solved | Unsolved |
4242
| --- | --- | --- | --- |
43-
| Easy | 4 | 4 | 0 |
43+
| Easy | 5 | 5 | 0 |
4444
| Medium | 9 | 7 | 2 |
45-
| Hard | 3 | 1 | 2 |
45+
| Hard | 4 | 1 | 3 |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class Solution:
2+
def triangleType(self, nums: list[int]) -> str:
3+
nums.sort()
4+
if nums[0] + nums[1] <= nums[2]:
5+
return 'none'
6+
7+
if nums[0] == nums[1]:
8+
if nums[1] == nums[2]:
9+
return 'equilateral'
10+
return 'isosceles'
11+
if nums[1] == nums[2]:
12+
return 'isosceles'
13+
return 'scalene'
14+
15+
16+
def main():
17+
nums = [3, 3, 3]
18+
assert Solution().triangleType(nums) == 'equilateral'
19+
20+
nums = [3, 4, 5]
21+
assert Solution().triangleType(nums) == 'scalene'
22+
23+
24+
if __name__ == '__main__':
25+
main()

0 commit comments

Comments
 (0)