Subtract the A [ i - M ] and add the A [ i ] in the map
if ( m . has ( A [ i - m ] ) ) m . set ( m . get ( A [ i - M ] ) , m . get ( A [ i - M ] ) - 1 ) ; if ( m . has ( A [ i ] ) ) m . set ( m . get ( A [ i ] ) , m . get ( A [ i ] ) + 1 ) ; val = 0 ;