texts[i] is the text of the i-th message and authors[i] is the name of the person who sent it. The same person may have sent several messages.
A message is a list of words separated by exactly one space, with no leading or trailing spaces. An author's word count is the total number of words across all of their messages.
Return the name of the author with the highest word count. On a tie, return the lexicographically greatest name. Names compare character by character: every uppercase English letter is smaller than every lowercase one, and "Bob" and "bob" are different authors.texts=["see you at noon", "ok", "running late sorry", "fine"], authors=["mira", "Tom", "Tom", "mira"] → 'mira'
mira wrote 4 + 1 = 5 words and Tom wrote 1 + 3 = 4, so mira wins.
texts=["hello there", "good night"], authors=["Zoe", "adam"] → 'adam'
Both wrote 2 words. Lowercase letters sort after uppercase ones, so "adam" is greater than "Zoe".
texts=["see you at noon", "ok", "running late sorry", "fine"], authors=["mira", "Tom", "Tom", "mira"]
'mira'
Run checks the first 3 tests in your browser. Submit checks all 118 tests on the server, hidden ones included.