From bfb934aa056d7040c55510090d0c2a49a6c66409 Mon Sep 17 00:00:00 2001 From: Duth <96284452+rumduth@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:24:32 -0600 Subject: [PATCH] Update Day_23.md Propose running time O(N) solution --- Status/Day_23.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Status/Day_23.md b/Status/Day_23.md index d7cf0c6..510f81e 100644 --- a/Status/Day_23.md +++ b/Status/Day_23.md @@ -77,7 +77,23 @@ runnerup = max(lst) print(runnerup) ``` --- +```Solution by: Thong Nguyen +def func95(): + scores = [int(x) for x in input().split(' ')] + max_score = -1 + runner_up = -1 + for s in scores: + if max_score == -1: + max_score = s + elif max_score < s: + runner_up, max_score = max_score, s + elif max_score > s: + if runner_up < s: + runner_up = s + + return runner_up +``` # Question 96 ### **Question**