← Plus One
Discussions
Sign in to join the discussion.
S
swathijoshi
1 week, 4 days 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.
💬 3 replies
L
likhitha.c
2 months ago
Asked in my BrowserStack OA last week.
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
K
kavyapat8
3 months ago
Intuition + complexity breakdown for Plus One.
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