Given a string, return the character that appears the maximum number of times in the string. The string will contain onl
Posted: Tue May 24, 2022 8:22 am
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")