LeetCode/kt/count-total-number-of-colored-cells.kt

3 lines
78 B
Kotlin

class Solution {
fun coloredCells(n: Int): Long = 1L + 2L * n * (n - 1)
}