Stores count of distinct values of arr [ i ] - x * i
if ( mp . has ( arr [ i ] - x * i ) ) { mp . set ( arr [ i ] - x * i , mp . get ( arr [ i ] - x * i ) + 1 ) } else { mp . set ( arr [ i ] - x * i , 1 ) } }