From 3d354b6e73184274c3c9b1802c78f7def34d1794 Mon Sep 17 00:00:00 2001 From: Alan Geirnaert Date: Sun, 22 Mar 2026 07:46:29 +0100 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 23f0b5c..9f49573 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Feel free to explore, learn, and share your own approaches. - [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 🌸 - [x] **3/21:** First Tweet 🐦 -- [x] **3/22:** Water Day 💧 +- [x] **3/22:** [Water Day](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-22-water-day) 💧 - [ ] **3/23:** ❓❓❓ - [ ] **3/24:** ❓❓❓ - [ ] **3/25:** ❓❓❓ From 6bf4784c24dc799e8bd91c35d0765864c7671bf1 Mon Sep 17 00:00:00 2001 From: Alan Geirnaert Date: Sun, 22 Mar 2026 07:46:38 +0100 Subject: [PATCH 2/2] feat: water day python solution --- march-2026/3-22-water-day/water-day.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 march-2026/3-22-water-day/water-day.py diff --git a/march-2026/3-22-water-day/water-day.py b/march-2026/3-22-water-day/water-day.py new file mode 100644 index 0000000..5a474c0 --- /dev/null +++ b/march-2026/3-22-water-day/water-day.py @@ -0,0 +1,14 @@ +def leaky_pipe(volume, leak, hours, threshold): + # for each passing hour + for i in range(hours): + # we calculate the new volume based on the formula + volume = volume * (1 - leak / 100) + + # check if treshold + if volume < threshold: + # if volume less than threshold, it failed + return -1 + + # otherwise we return the new volume + # once the loop is over, rounded by 2 decimals + return round(volume, 2) \ No newline at end of file