From 38780ecb7727ea83711d8712be75ceb31efe3876 Mon Sep 17 00:00:00 2001 From: alangnt Date: Sun, 29 Mar 2026 21:07:59 +0200 Subject: [PATCH 1/2] chore: updated README file with todays link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 213df0a..025250c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,6 @@ Feel free to explore, learn, and share your own approaches. - [ ] **3/26:** Flatten Array 🪜 - [ ] **3/27:** Infinite Monkey Theorem 🐒 - [ ] **3/28:** 28 Days Later 🧟 -- [ ] **3/29:** Leaderboard Stats 📊 +- [ ] **3/29:** [Leaderboard Stats](https://github.com/codedex-io/daily-challenges/tree/main/march-2026/3-29-leaderboard-stats) 📊 - [ ] **3/30:** ❓❓❓ - [ ] **3/31:** ❓❓❓ From 1703d426c0f75d09baa46086b7df602850132c63 Mon Sep 17 00:00:00 2001 From: alangnt Date: Sun, 29 Mar 2026 21:08:08 +0200 Subject: [PATCH 2/2] feat: leaderboard stats python solution --- .../3-29-leaderboard-stats/leaderboard-stats.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 march-2026/3-29-leaderboard-stats/leaderboard-stats.py diff --git a/march-2026/3-29-leaderboard-stats/leaderboard-stats.py b/march-2026/3-29-leaderboard-stats/leaderboard-stats.py new file mode 100644 index 0000000..bc142f4 --- /dev/null +++ b/march-2026/3-29-leaderboard-stats/leaderboard-stats.py @@ -0,0 +1,12 @@ +def average_time(total, completed): + # first we split the time + time_parts = total.split(":") + + # then we define each time unit + hours, minutes, seconds = int(time_parts[0]), int(time_parts[1]), int(time_parts[2]) + + # now we calculate the total seconds + total_seconds = hours * 3600 + minutes * 60 + seconds + + # and we return the average + return round(total_seconds / completed) \ No newline at end of file