Push the pair of { i + 1 , j + 1 } in mp [ arr [ i ] [ j ] ]
if ( mp . has ( arr [ i ] [ j ] ) ) { let temp = mp . get ( arr [ i ] [ j ] ) ; temp . push ( [ i + 1 , j + 1 ] ) ; mp . set ( arr [ i ] [ j ] , temp ) ; } else { mp . set ( arr [ i ] [ j ] , [ [ i + 1 , j + 1 ] ] ) ; } } }