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 #2024_01_16_Time_320_ms_(58.62%)_Space_49.8_MB_(48.28%)

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