Search
⌘K

Leetcode 35. Search Insert Position

Given a sorted array of distinct integers and a target, return the index where the target is found or the index where it should be inserted to keep the array sorted. Solve in O(log n) time (use binary-search-style search).

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late January, 2025

Meta

Mid-level

Comments

Your account is free and you can post anonymously if you choose.