Skip to content

Commit da8d919

Browse files
committed
Fixed solution
1 parent 8070153 commit da8d919

File tree

1 file changed

+3
-1
lines changed
  • src/main/kotlin/g1701_1800/s1713_minimum_operations_to_make_a_subsequence

1 file changed

+3
-1
lines changed

src/main/kotlin/g1701_1800/s1713_minimum_operations_to_make_a_subsequence/Solution.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package g1701_1800.s1713_minimum_operations_to_make_a_subsequence
33
// #Hard #Array #Hash_Table #Greedy #Binary_Search
44
// #2023_06_16_Time_862_ms_(100.00%)_Space_67.3_MB_(100.00%)
55

6+
import java.util.Arrays
7+
68
class Solution {
79
fun minOperations(target: IntArray, arr: IntArray): Int {
810
val map: MutableMap<Int, Int> = HashMap()
@@ -23,7 +25,7 @@ class Solution {
2325
var l = 0
2426
val arr = IntArray(n)
2527
for (num in list) {
26-
var index = arr.binarySearch(0, l, num!!)
28+
var index = Arrays.binarySearch(arr, 0, l, num!!)
2729
if (index < 0) {
2830
index = index.inv()
2931
}

0 commit comments

Comments
 (0)