Search⌘ K
AI Features

Solution: Max Consecutive Ones

Solution: Max Consecutive Ones gives you a binary array and asks for the length of its longest uninterrupted run of ones, returning zero when no ones appear.

Statement

You are given a binary array nums (an array that contains only 00s and ...