Pull to refresh

Comments 2

The first algorithm seems to be wrong.
Assume A = [0, 100], B = [2, 1], x = 10.
Then the correct answer is 1 (just nullify the second component).
While your algorithm will return -1

The code above returns a result 1.

```swift
// Test case
let solution = Solution()
let nums1 = [0, 100]
let nums2 = [2, 1]
let x = 10
let result = solution.minimumTime(nums1, nums2, x)
print(result) // The output is 1

```

What exactly do you mean?

Sign up to leave a comment.

Articles