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…