We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 316b25c commit d8b3deaCopy full SHA for d8b3dea
src/main/java/g3501_3600/s3527_find_the_most_common_response/Solution.java
@@ -39,10 +39,8 @@ public String findCommonResponse(List<List<String>> responses) {
39
arr[1] = row;
40
mp.put(resp, arr);
41
}
42
- if (arr[0] > maxFreq) {
43
- ans = resp;
44
- maxFreq = arr[0];
45
- } else if (!ans.equals(resp) && arr[0] == maxFreq && compareStrings(resp, ans)) {
+ if (arr[0] > maxFreq
+ || !ans.equals(resp) && arr[0] == maxFreq && compareStrings(resp, ans)) {
46
ans = resp;
47
maxFreq = arr[0];
48
0 commit comments