Answer to Question #334004 in C++ for guram

Question #334004

Please write in C++ a solution to the following problem. Having a list of words (which are sequences of small letters), one word per one line, sort them according to the following order: word_1 is smaller that word_2 if word_1 contains more letters ‘a’, and in the case of the equal number of ‘a’ letters in both words, consider the number of letter ‘b’, and as a smaller word take word with bigger number of letter ‘b’, and so on. In the case of two words have the same number of equivalent letters, take into account lexicographic order between them. For example: baabca is bigger that ccaaaa (3 x ‘a’ vs 4 x ‘a’), and xababx is smaller than abacd (2 x ‘a’ in both words, but 2 x ‘b’ in the first one vs 1 x ‘b’ in the second one word). Word bbaaxx is smaller than xxaabb. An example input and output. Input: ale james john ela alexander kamil Output: alexander james ale ela kamil john


0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS