Problem
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Java
1 | class Solution { |
Submission Detail
- 62 / 62 test cases passed.
- Runtime: 0 ms, faster than 100.00% of Java online submissions for Search Insert Position.
- Memory Usage: 38.9 MB, less than 100.00% of Java online submissions for Search Insert Position.