Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahliu committed Dec 30, 2024
1 parent 9ffe764 commit 8764cf7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/kotlin/p30xx/Problem3046.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package p30xx

import util.expect

fun main() {
class Solution {
fun isPossibleToSplit(nums: IntArray): Boolean {
val set1 = hashSetOf<Int>()
val set2 = hashSetOf<Int>()

return nums.all { set1.add(it) || set2.add(it) }
}
}

expect {
Solution().isPossibleToSplit(
intArrayOf(1, 1, 0, 0, 0, 1, 1, 0, 0, 1), 3
)
}
}

0 comments on commit 8764cf7

Please sign in to comment.