Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahliu committed Nov 29, 2024
1 parent f50d07a commit 03b094a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/kotlin/p32xx/Problem3232.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package p32xx

import util.expect

fun main() {
class Solution {
fun canAliceWin(nums: IntArray): Boolean {
val sums = IntArray(3)
nums.forEach {
when {
it < 10 -> sums[0] += it
it < 100 -> sums[1] += it
else -> sums[2] += it
}
}

return sums[0] > sums[1] + sums[2] || sums[1] > sums[0] + sums[2]
}
}

expect {
Solution().canAliceWin(
intArrayOf()
)
}
}

0 comments on commit 03b094a

Please sign in to comment.