- Given A String Return The Character That Appears The Maximum Number Of Times In The String The String Will Contain Onl 1 (41.85 KiB) Viewed 19 times
Given a string, return the character that appears the maximum number of times in the string. The string will contain onl
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Given a string, return the character that appears the maximum number of times in the string. The string will contain onl
Given a string, return the character that appears the maximum number of times in the string. The string will contain only ASCII characters, from the ranges ('a'-'z','A'-'Z','0¹-'9'), and case matters. If there is a tie in the maximum number of times a character appears in the string, return the character that appears first in the string. Example text = abbbaacc Both 'a' and 'b'occur 3 times in text. Since 'a' occurs earlier, a is the answer. Function Description Complete the function maximumOccurring Character in the editor below. maximumOccurring Character has the following parameter: string text: the string to be operated upon Returns char: The most occurring character that appears first in the string. Constraints 10 ≤ |text| ≤ 104 All characters are alphanumeric, in the ranges ('a'- '7''A''7' 09")