SIGMOID AI Hiring On-Campus OA (2025) | Longest Subarray of 1's After Deleting One Element

Question · Posted Jun 2026

Problem Statement Given a binary array nums, you must delete exactly one element from the array. After deleting one element, find the length of the longest non-empty subarray containing only 1s. Return the maximum possible length. Note You must delete exactly one element. The deleted element can be either 0 or 1. If the array contains all 1s, one element must still be deleted. Input Format An integer array nums consisting only of 0s and 1s. Example 1 Input nums ...

The full answer & interview discussion are available to premium members.

Log in Create a free account