Objects should have clear boundaries and responsibilities.
An algorithm is not an object. It has behavior but no properties.
Constant iterators allow the programmer to traverse a container that has been declared constant.
If the the item being created has a constructor, the constructor is called.
As additional conditions are discovered during testing or use, these should be added to the unit test suite.
a 1
b 2
c 3
d 4
e 5
f 1
g 1
h 1
Please see wordCountAnswer.cpp