From fa39b591fe9a7ccad6e6396b37a974c25007107c Mon Sep 17 00:00:00 2001 From: alangnt Date: Fri, 20 Mar 2026 09:34:43 +0100 Subject: [PATCH 1/2] chore: updated README file with today's link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e88867e..acc63cc 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ Feel free to explore, learn, and share your own approaches. - [ ] **3/16:** [Oscars 2026](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-16-oscars-2026) 🏆 - [ ] **3/17:** [Green Chicago River](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-17-green-chicago-river) 🍀 - [ ] **3/18:** [Flight Vouchers](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-18-flight-vouchers) 🏖️ -- [ ] **3/19:** [March Madness](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-19-march-madness) 🏀 -- [ ] **3/20:** Blossom Forecast 🌸 +- [x] **3/19:** [March Madness](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-19-march-madness) 🏀 +- [x] **3/20:** [Cherry Blossoms](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-20-cherry-blossoms) 🌸 - [ ] **3/21:** ❓❓❓ - [ ] **3/22:** ❓❓❓ - [ ] **3/23:** ❓❓❓ From 1278a0bebf57743dcb452fe0ea038bf5296940f2 Mon Sep 17 00:00:00 2001 From: alangnt Date: Fri, 20 Mar 2026 09:35:08 +0100 Subject: [PATCH 2/2] feat: cherry blossoms python solution + explanations --- .../3-20-cherry-blossoms/cherry-blossoms.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 march-2026/3-20-cherry-blossoms/cherry-blossoms.py diff --git a/march-2026/3-20-cherry-blossoms/cherry-blossoms.py b/march-2026/3-20-cherry-blossoms/cherry-blossoms.py new file mode 100644 index 0000000..b648911 --- /dev/null +++ b/march-2026/3-20-cherry-blossoms/cherry-blossoms.py @@ -0,0 +1,15 @@ +def cherry_blossoms(temps): + # for i starting at index 4 + # since we need at least 5 days of data + for i in range(4, len(temps)): + # current window of 5 days + # taking last 4 days + today + window = temps[i-4:i+1] + + # if the average is at least 15 + # return the day + if sum(window) / 5 >= 15: + return i + 1 + + # else return -1 + return -1 \ No newline at end of file