Changed the return type of main from void into int.
Removed a global variable key.
Changed the function using a global variable into functor.
Avoid to hold unnecessary input data.
Removed unnecessary string copy.
Implemented prunning. stop to check strings when more than 1 occurence
of the odd count character were found.
Used static key list.
Moved the generation of the key list outside of the loop.