bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyArrays & HashingLC 485

Max Consecutive Ones

Given a binary array nums, return the maximum number of consecutive 1's in the array.

Asked at 3 companies
AmazonGoogleMicrosoft
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode