File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/main/kotlin/g3601_3700/s3636_threshold_majority_queries Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ internal class Solution {
16
16
}
17
17
}
18
18
19
- // A helper class to store a query's range and its original index.
20
19
private class Query (var l : Int , var r : Int , var originalIndex : Int )
21
20
22
21
private lateinit var nums: IntArray
@@ -70,13 +69,12 @@ internal class Solution {
70
69
if (blockA != blockB) {
71
70
return @sortWith blockA.compareTo(blockB)
72
71
}
73
- if ((blockA % 2 ) == 1 ) {
74
- return @sortWith b.r.compareTo(a.r)
72
+ return @sortWith if ((blockA % 2 ) == 1 ) {
73
+ b.r.compareTo(a.r)
75
74
} else {
76
- return @sortWith a.r.compareTo(b.r)
75
+ a.r.compareTo(b.r)
77
76
}
78
77
}
79
-
80
78
val ans = IntArray (qLen)
81
79
var currentL = 0
82
80
var currentR = - 1
You can’t perform that action at this time.
0 commit comments