← Max Consecutive Ones
Discussions
Sign in to join the discussion.
A
aaravsingh
OFFICIAL
2 months, 2 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
3 weeks 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
1 month, 4 weeks 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
3 months, 1 week 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