Skip to content · ⁨Lompat ke konten⁩

Second largest · ⁨Nilai terbesar kedua⁩

English

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].

Bahasa Indonesia

Kedua terbesar

Kembalikan nilai terbesar kedua yang berbeda. Duplikat dari maksimum tidak dihitung, sehingga [5, 5, 4] menghasilkan 4, bukan 5.

Saluran bersih: hapus duplikat dengan set(...), urutkan hasilnya, dan ambil nilai satu posisi dari akhir dengan [-2].

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP