remove the current element from the hash map by decreasing the frequency to avoid counting when the number is a palindrome or when we visit its reverse
if ( freq . has ( arr [ i ] ) ) { freq . set ( arr [ i ] , freq . get ( arr [ i ] ) - 1 ) ; } else { freq . set ( arr [ i ] , - 1 ) ; }