Skip to content

Commit 3c8ff43

Browse files
committed
May 11
1 parent 6a1cc1c commit 3c8ff43

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| May 08 | [3342. Find Minimum Time to Reach Last Room II](https://leetcode.com/problems/find-minimum-time-to-reach-last-room-ii/) | Medium | Solved |
1515
| May 09 | [3343. Count Number of Balanced Permutations](https://leetcode.com/problems/count-number-of-balanced-permutations/) | Hard | Unsolved |
1616
| May 10 | [2918. Minimum Equal Sum of Two Arrays After Replacing Zeros](https://leetcode.com/problems/minimum-equal-sum-of-two-arrays-after-replacing-zeros/) | Medium | Solved |
17-
| May 11 | []() | | |
17+
| May 11 | [1550. Three Consecutive Odds](https://leetcode.com/problems/three-consecutive-odds/) | Easy | Solved |
1818
| May 12 | []() | | |
1919
| May 13 | []() | | |
2020
| May 14 | []() | | |
@@ -40,6 +40,6 @@
4040
## Summary
4141
| Level | Problems | Solved | Unsolved |
4242
| --- | --- | --- | --- |
43-
| Easy | 2 | 2 | 0 |
43+
| Easy | 3 | 3 | 0 |
4444
| Medium | 6 | 6 | 0 |
4545
| Hard | 2 | 1 | 1 |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Solution:
2+
def threeConsecutiveOdds(self, arr: list[int]) -> bool:
3+
for i in range(0, len(arr) - 2):
4+
if arr[i] & 1 != 0 and arr[i + 1] & 1 != 0 and arr[i + 2] & 1 != 0:
5+
return True
6+
return False
7+
8+
9+
def main():
10+
arr = [2, 6, 4, 1]
11+
assert Solution().threeConsecutiveOdds(arr) is False
12+
13+
arr = [1, 2, 34, 3, 4, 5, 7, 23, 12]
14+
assert Solution().threeConsecutiveOdds(arr) is True
15+
16+
17+
if __name__ == '__main__':
18+
main()

0 commit comments

Comments
 (0)