comefrom: <awangdev>Contiguous Array_2.java
code: public int findMaxLength(int[] nums) {
          if (nums == null || nums.length == 0) return 0;
          Map<Integer, Integer> map = new HashMap<>();
          map.put(0, -1);
  
          int preSum = 0, max = 0;
          for (int i = 0; i < nums.length; i++) {
              preSum += nums[i];
              int k = preSum - i - 1;
              if (map.containsKey(preSum - k)) {
                  max = Math.max(max, i - map.get(preSum - k));
              }
              if (!map.containsKey(preSum)) {
                  map.put(preSum, i);
              }
          }
  
          return max;
      }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 ) return 0 ;
    Map < Integer , Integer > var_7 = new HashMap < > ( ) ;
    var_7 . put ( 0 , - 1 ) ;
    int var_10 = 0 , max = 0 ;
    for ( int var_12 = 0 ;
    var_12 < var_0 . length ;
    var_12 ++ ) {
      var_10 += var_0 [ var_12 ] ;
      int var_13 = var_10 - var_12 - 1 ;
      if ( var_7 . containsKey ( var_10 - var_13 ) ) {
        max = Math . max ( max , var_12 - var_7 . get ( var_10 - var_13 ) ) ;
      }
      if ( ! var_7 . containsKey ( var_10 ) ) {
        var_7 . put ( var_10 , var_12 ) ;
      }
    }
    return max ;
  }
  