File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
2025-02-February-LeetCoding-Challenge Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ from typing import List
2+
3+
4+ class Solution :
5+ def check (self , nums : List [int ]) -> bool :
6+ return sum (nums [i ] < nums [i - 1 ] for i in range (len (nums ))) <= 1
7+
8+
9+ def main ():
10+ nums = [3 , 4 , 5 , 1 , 2 ]
11+ assert Solution ().check (nums ) is True
12+
13+ nums = [2 , 1 , 3 , 4 ]
14+ assert Solution ().check (nums ) is False
15+
16+ nums = [1 , 2 , 3 ]
17+ assert Solution ().check (nums ) is True
18+
19+
20+ if __name__ == '__main__' :
21+ main ()
Original file line number Diff line number Diff line change 55| Day | Problem | Level | Status |
66| --- | --- | --- | --- |
77| February 01 | [ 3151. Special Array I] ( https://leetcode.com/problems/special-array-i/ ) | Easy | Solved |
8- | February 02 | [ ] ( ) | | |
8+ | February 02 | [ 1752. Check if Array Is Sorted and Rotated ] ( https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/ ) | Easy | Solved |
99| February 03 | [ ] ( ) | | |
1010| February 04 | [ ] ( ) | | |
1111| February 05 | [ ] ( ) | | |
3737## Summary
3838| Level | Problems | Solved | Unsolved |
3939| --- | --- | --- | --- |
40- | Easy | 1 | 1 | 0 |
40+ | Easy | 2 | 2 | 0 |
4141| Medium | 0 | 0 | 0 |
4242| Hard | 0 | 0 | 0 |
You can’t perform that action at this time.
0 commit comments