Storing the vowels in the map with custom numbers showing their index
map < char , int > m ; m [ ' a ' ] = 0 ; m [ ' e ' ] = 1 ; m [ ' i ' ] = 2 ; m [ ' o ' ] = 3 ; m [ ' u ' ] = 4 ; char arr [ 5 ] = { ' a ' , ' e ' , ' i ' , ' o ' , ' u ' } ; int N = str . length ( ) ;