package leetcode;

/**
 * https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element/
 */
public class Problem1493 {
    public int longestSubarray(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1493 prob = new Problem1493();
        System.out.println(prob.longestSubarray(new int[]{1,1,0,1})); // 3
        System.out.println(prob.longestSubarray(new int[]{0,1,1,1,0,1,1,0,1})); // 5
        System.out.println(prob.longestSubarray(new int[]{1,1,1})); // 2
        System.out.println(prob.longestSubarray(new int[]{1,1,0,0,1,1,1,0,1})); // 4
        System.out.println(prob.longestSubarray(new int[]{0,0,0})); // 0
    }
}

@@ -172,24 +172,100 @@
 t%5B%5D nums) %7B%0A
+        int answer = 0;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A    
         // T
@@ -268,16 +268,26 @@
 // TODO%0A
+        %7D%0A
         
@@ -293,17 +293,22 @@
  return 
-0
+answer
 ;%0A    %7D%0A
@@ -559,16 +559,101 @@
 ); // 5%0A
+        System.out.println(prob.longestSubarray(new int%5B%5D%7B0,1,1,0,1,1,1,0,1%7D)); // 5%0A
         

Update problem 1493