Stores the frequencies of array elements
var mapA = new Map ( ) , mapB = new Map ( ) ; for ( var i = 0 ; i < n ; i ++ ) { if ( mapA . has ( A [ i ] ) ) mapA . set ( A [ i ] , mapA . get ( A [ i ] ) + 1 ) else mapA . set ( A [ i ] , 1 ) if ( mapB . has ( B [ i ] ) ) mapB . set ( B [ i ] , mapB . get ( B [ i ] ) + 1 ) else mapB . set ( B [ i ] , 1 ) }