NewThe Learning module is now liveSee what's new

A text analysis tool needs to report the most frequent words in a piece of text.

You are given a string text that contains English letters and spaces, where words are separated by spaces. Count every word in a case-insensitive way, then return the words that belong to the highest-frequency groups along with their frequency. You need to return an array that applies the rules below:

Test Cases
Input
Output
Expected