maintain 0 for initial values of i upto R Once i = R , then we need to erase that 0 from our multiset as our first index of subarray cannot be 0 anymore .
s1 . add ( 0 ) ; int ans = Integer . MIN_VALUE ; ans = Math . max ( ans , pre [ L - 1 ] ) ;