Use std::map to calculate density of elements
Often there might be a need to calculate how many times each element from a particular collection appears in that collection. For example, having a string, we might want to how many times each letter appears, or how many times each word...