From 96b71e91a573d15f5ecf3827b1562e27c89df951 Mon Sep 17 00:00:00 2001 From: alangnt Date: Tue, 31 Mar 2026 08:17:42 +0200 Subject: [PATCH 1/2] chore: updated README file with today's challenge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4a2dca..e229b67 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,4 @@ Feel free to explore, learn, and share your own approaches. - [x] **3/28:** 28 Days Later 🧟 - [x] **3/29:** Leaderboard Stats 📊 - [x] **3/30:** Ye Old Emoticons 📰 -- [ ] **3/31:** My Best Streak 🔥 +- [x] **3/31:** [My Best Streak](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-31-my-best-streak) 🔥 From a9ec0690164969fe2c49d69319e09bfbf332754d Mon Sep 17 00:00:00 2001 From: alangnt Date: Tue, 31 Mar 2026 08:17:54 +0200 Subject: [PATCH 2/2] feat: my best streak python solution --- .../3-31-my-best-streak/my-best-streak.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 march-2026/3-31-my-best-streak/my-best-streak.py diff --git a/march-2026/3-31-my-best-streak/my-best-streak.py b/march-2026/3-31-my-best-streak/my-best-streak.py new file mode 100644 index 0000000..58cdc9d --- /dev/null +++ b/march-2026/3-31-my-best-streak/my-best-streak.py @@ -0,0 +1,19 @@ +def longest_streak(progress): + # define best and current streaks + best_streak = 0 + current_streak = 0 + + # for each day + for day in progress: + # if completed, add 1 to current + if day == "✅": + current_streak += 1 + # if current higher than best + # replace best by current + if current_streak > best_streak: + best_streak = current_streak + # else reset current + else: + current_streak = 0 + + return best_streak \ No newline at end of file