We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1cb8ee commit 838b529Copy full SHA for 838b529
src/main/kotlin/g3401_3500/s3414_maximum_score_of_non_overlapping_intervals/Solution.kt
@@ -1,7 +1,7 @@
1
package g3401_3500.s3414_maximum_score_of_non_overlapping_intervals
2
3
// #Hard #Array #Dynamic_Programming #Sorting #Binary_Search
4
-// #2025_01_09_Time_918_(100.00%)_Space_87.41_(100.00%)
+// #2025_01_09_Time_892_(100.00%)_Space_91.42_(100.00%)
5
6
class Solution {
7
fun maximumWeight(intervals: List<List<Int>>): IntArray {
@@ -10,7 +10,6 @@ class Solution {
10
ns.sortBy { it[0] }
11
var dp1 = Array<IntArray>(n) { IntArray(0) }
12
var dp = LongArray(n)
13
- ns.sortWith { a: IntArray?, b: IntArray? -> a!![0] - b!![0] }
14
repeat(4) {
15
val dp3 = Array<IntArray>(n) { IntArray(0) }
16
val dp2 = LongArray(n)
0 commit comments