← Max Consecutive Ones
Discussions
Sign in to join the discussion.
A
aaravsingh
OFFICIAL
3 months, 4 weeks ago
Clean Python 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
V
vamsisax3
2 months ago
Intuition + complexity breakdown for Max Consecutive Ones.
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.
💬 2 replies
P
poojamenon
3 months, 1 week ago
Asked in my Salesforce 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.
💬 3 replies
A
aaravsingh
4 months, 3 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.
💬 3 replies