Skip to content · ⁨본문 바로가기⁩

Second largest · ⁨두 번째로 큰 값⁩

Second largest

Return the second-biggest distinct value. Duplicates of the maximum don't count, so [5, 5, 4] gives 4, not 5.

One clean route: drop duplicates with set(...), sort the result, and take the value one in from the end with [-2].

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP