You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Maintain 2 counters. Add 1 in both during each iteration of loop of nums. If you get a 0, check the highest of 2 and assign it to max_count (but reduce 1 because it has counted a 0 in it which needs to be removed). Then make counter2 what was counter1 and reset counter1. Basically counter1 is counting from last 0 to current and counter2 is counting from 2nd last 0 to current.