로딩
요청 처리 중입니다...

SQL_LeetCode 2418_Sort the People

 SQL_LeetCode 2418_Sort the People

SQL_LeetCode 2418_Sort the People 풀이 class Solution { public String[] sortPeople(String[] names, int[] heights) { // height를 key로 이름을 넣고 height를 정렬해서 height별 이름을 추출한다. Map map = new HashMap(); int n = names.length, j = 0; for (int i = 0; i < n; ++i) map.put(heights[i], names[i]); Arrays.sort(heights); for (int i = n - 1; i >= 0; i--) names[j++] = map.get(heights[i]); return names; } } * 출처 https://leetcode.com/problems/sort-the-people...

# LeetCode2418_SortthePeople # SQL # SQL_LeetCode2418 # SQL_LeetCode2418_SortthePeople # SQL_SortthePeople