Traversing hashmap and finding duplicate elements .
foreach ( KeyValuePair < char , int > e in hm ) { int x = e . Value ; if ( x > 1 ) { int temp5 = factorial ( x ) ; f = f / temp5 ; } } return f ; } static void nextPermutation ( char [ ] temp ) {