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 03fcf17 commit adf4ce0Copy full SHA for adf4ce0
src/main/kotlin/g3501_3600/s3587_minimum_adjacent_swaps_to_alternate_parity/Solution.kt
@@ -31,13 +31,11 @@ class Solution {
31
return ans
32
}
33
34
- companion object {
35
- private fun helper(indices: MutableList<Int>): Int {
36
- var swaps = 0
37
- for (i in indices.indices) {
38
- swaps += abs(indices[i] - 2 * i)
39
- }
40
- return swaps
+ private fun helper(indices: MutableList<Int>): Int {
+ var swaps = 0
+ for (i in indices.indices) {
+ swaps += abs(indices[i] - 2 * i)
41
+ return swaps
42
43
0 commit comments