Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feel free to explore, learn, and share your own approaches.
- [x] **3/22:** Water Day 💧
- [x] **3/23:** Cuddly Kittens 🐈
- [x] **3/24:** Earthquake Anomaly 🌏
- [x] **3/25:** Opening Day ⚾️
- [x] **3/25:** [Opening Day](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-25-opening-day) ⚾️
- [ ] **3/26:** ❓❓❓
- [ ] **3/26:** ❓❓❓
- [ ] **3/28:** ❓❓❓
Expand Down
17 changes: 17 additions & 0 deletions march-2026/3-25-opening-day/opening-day.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def streak_counter(games):
best_streak = 0
current_streak = 0

# for each game
for game in games:
# if it's a win
if game == "W":
# add 1 to current streak and return highest value
# between best and current
current_streak += 1
best_streak = max(best_streak, current_streak)
elif game == "L":
# else if lose current streak goes to 0
current_streak = 0

return best_streak