HTMLify
LeetCode - Search Insert Position - Go
Views: 164 | Author: abh
func searchInsert(nums []int, target int) int {
for i, v := range nums {
if target <= v {
return i
}
}
return len(nums)
}
Comments

I didn't expect this to be solved by a linear approach -_-
Reply(Mention)