I am trying to find out number of occurrences of each element in string. for example string str="aabacdbccdd". a=3, b=2, c=3, d=3.
I am getting error at below loop. Constraints and l are strings.
for (int i = 0; i < constraints.size(); i++)
{
size_t mycount = std::count(l.begin(), l.end(), constraints[i]);
}
Error is: No operator found which takes a left-hand of operand of type 'char'
Could you please help what is the error over here.
Thanks.