← Search Insert Position
Discussions
Sign in to join the discussion.
D
deepikades8
OFFICIAL
14 hours, 23 minutes ago
Why does my solution TLE on the last test case?
A single pass with a running value is enough here. Keep track of the best answer so far and update it as you scan, which gives O(n) time and O(1) extra space.
💬 1 reply
V
vedantchowdary
OFFICIAL
4 months, 2 weeks ago
Clean Java solution, beats most submissions.
A single pass with a running value is enough here. Keep track of the best answer so far and update it as you scan, which gives O(n) time and O(1) extra space.
💬 1 reply
S
sanjanasub6
2 months, 2 weeks ago
Simple approach explained for beginners.
A single pass with a running value is enough here. Keep track of the best answer so far and update it as you scan, which gives O(n) time and O(1) extra space.
💬 0 replies
A
aksharakulkarni
3 months, 2 weeks ago
Intuition + complexity breakdown for Search Insert Position.
A single pass with a running value is enough here. Keep track of the best answer so far and update it as you scan, which gives O(n) time and O(1) extra space.
💬 3 replies