Traversing hashmap and finding duplicate elements .
for ( let [ key , value ] of hm . entries ( ) ) { let x = value ; if ( x > 1 ) { let temp5 = factorial ( x ) ; f = Math . floor ( f / temp5 ) ; } } return f ; } function nextPermutation ( temp ) {