Skip to content

Commit e898ab3

Browse files
committed
searchInsert
1 parent 2072e84 commit e898ab3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

searchInsert.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var searchInsert = function(nums, target) {
2+
for (let x = 0; x < nums.length; x++){
3+
let current = nums[x];
4+
if (current >= target){
5+
return x
6+
}
7+
}
8+
9+
return nums.length;
10+
};

0 commit comments

Comments
 (0)