Iterating over the map
foreach ( KeyValuePair < int , int > it in freq ) { if ( it . Value % 2 == 1 ) count ++ ; } if ( count > k ) Console . Write ( " No " + " STRNEWLINE " ) ; else Console . Write ( " Yes " + " STRNEWLINE " ) ; }