3527. Find the Most Common Response
You are given a 2D string array
responseswhere eachresponses[i]is an array of strings representing survey responses from theithday.Return the most common response across all days after removing duplicate responses within each
responses[i]. If there is a tie, return the lexicographically smallest response.A string
ais lexicographically smaller than a stringbif in the first position whereaandbdiffer, stringahas a letter that appears earlier in the alphabet than the corresponding letter inb.
If the firstmin(a.length, b.length)characters do not differ, then the shorter string is the lexicographically smaller one.
1 | class Solution { |