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 {
1616 }
1717 }
1818
19- // A helper class to store a query's range and its original index.
2019 private class Query (var l : Int , var r : Int , var originalIndex : Int )
2120
2221 private lateinit var nums: IntArray
@@ -70,13 +69,12 @@ internal class Solution {
7069 if (blockA != blockB) {
7170 return @sortWith blockA.compareTo(blockB)
7271 }
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)
7574 } else {
76- return @sortWith a.r.compareTo(b.r)
75+ a.r.compareTo(b.r)
7776 }
7877 }
79-
8078 val ans = IntArray (qLen)
8179 var currentL = 0
8280 var currentR = - 1
You can’t perform that action at this time.
0 commit comments