In a special ranking system, each voter gives a rank from highest to lowest to all teams participated in the competition.
The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first position, we consider the second position to resolve the conflict, if they tie again, we continue this process until the ties are resolved. If two or more teams are still tied after considering all positions, we rank them alphabetically based on their team letter.
Given an array of strings votes which is the votes of all voters in the ranking systems. Sort all teams according to the ranking system described above.
Return a string of all teams sorted by the ranking system.
만약 2 or 더 많은 팀이 동점일 때 처음 포지션에서, 문제를 풀기위해 두 번째 포지션을 고려한다, 여기서도 동점이면 계속해서 이 과정을 반복. 모든 포지션이 동점이면 알파벳순으로 랭크를 한다.
주어진 문자 배열은 투표들이다.
이것으로 모든 팀의 랭킹을 정렬하라.
랭킹 시스템에 의해 정렬된 팀의 문자를 반환
예는 Leectcode에서 보슈 , 해석은 내맘대로 했습니다,,
'Leetcode' 카테고리의 다른 글
Leetcode <Sort> 1235. Maximum Profit in Job Scheduling 44.1% Hard (0) | 2020.04.11 |
---|---|
Leetcode <Binary Search> 287. Find the Duplicate Number 53.1% Medium (0) | 2020.04.10 |
Leetcode <Binary Search> 704. Binary Search 50.8% Easy (0) | 2020.04.10 |
Leetcode <Sort> 242. Valid Anagram 백준 6996번 애너그램 (0) | 2020.04.05 |
Leetcode 328. Odd Even Linked List 52.5% Medium (0) | 2020.04.03 |
댓글