Given a string str that consists of only 'a' and 'b'. Write a C++ function that takes the string str as parameter and returns true if the frequncy of both 'a' and 'b' is same, else the function returns false. Test the function for str = "aababb" and str = "abbabb"

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 14E
icon
Related questions
Question
100%

Given a string str that consists of only 'a' and 'b'. Write a C++ function that takes the string str as parameter and returns true if the frequncy of both 'a' and 'b' is same, else the function returns false.

Test the function for str = "aababb" and str = "abbabb"

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr