Insert all votes in a hashmap
Dictionary < String , int > map = new Dictionary < String , int > ( ) ; foreach ( String str in votes ) { if ( map . ContainsKey ( str ) ) map [ str ] = map [ str ] + 1 ; else map . Add ( str , 1 ) ; }