Create the function and 2 variables: max and counter. Set the value of max to an empty string: "", and the value of counter to 0. Then iterate over the characters in the parameter string using a for loop. Use the in-built String function "count(substring)" to count the number of times the i'th characters appears in the string. Check if count(i) is greater than counter. If yes, set the value of max to i and the value of counter to count(i). Return the tuple max, counter.def most_occuring_char(string): max = "" counter = 0
for c in string: if string.count(c) > counter: max = c counter = count(c)
return max, counter The time complexity of the solution is O(n2) as the function iterates over all characters in the string and uses the in-built function "count(substring)" which iterates over the string for each character to count it's occurrences.