Skip to content

Commit 0a654b0

Browse files
add problem description
1 parent bf6a425 commit 0a654b0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lintcode/src/chapter2_binary_search/SearchInsertPosition.java

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
package chapter2_binary_search;
2+
/**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.
23
4+
You may assume NO duplicates in the array.
5+
6+
Have you met this question in a real interview? Yes
7+
Example
8+
[1,3,5,6], 5 → 2
9+
10+
[1,3,5,6], 2 → 1
11+
12+
[1,3,5,6], 7 → 4
13+
14+
[1,3,5,6], 0 → 0
15+
16+
*/
317
public class SearchInsertPosition {
418

519
/**

0 commit comments

Comments
 (0)