Question: Complete the c++ function string histogram (const vector & v): so that given the reference to a vector of strings, return, in the specified format,
Complete the c++ function string histogram (const vector& v): so that given the reference to a vector of strings, return, in the specified format, a count of the strings, from the most frequent to the least frequent. For example: given v = {"dog", "lion", "lion", "seal", "dog", "dog", "dog"} will return "[dog: 4] [lion: 2] [seal: 1]"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
