Leetcode 1493: Longest Subarray of 1’s After Deleting One Element

In this Leetcode problem, we want to find the longest possible chain of ones when we remove one element of the array.

Problem statement

A couple of ideas to find the solution:

  • At the end of each series of 1s we want to compute the chain of maximum length that ends with that last 1 by removing an element of…

--

--

Likes to code and to learn.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store