All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g2901_3000.s2923_find_champion_i.Solution.kt Maven / Gradle / Ivy

There is a newer version: 1.30
Show newest version
package g2901_3000.s2923_find_champion_i

// #Easy #Array #Matrix #2023_12_31_Time_591_ms_(5.63%)_Space_49.8_MB_(36.62%)

class Solution {
    fun findChampion(grid: Array): Int {
        var champion = grid[1][0]
        for (opponent in 2 until grid.size) {
            if (grid[opponent][champion] != 0) {
                champion = opponent
            }
        }
        return champion
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy