import java.util.*;
class Solution {
public String[] solution(String[] strings, int n) {
Arrays.sort(strings);
List<String> sortList = Arrays.asList(strings);
sortList.sort((o1,o2) -> Character.compare(o1.charAt(n),o2.charAt(n)));
return sortList.toArray(new String[0]);
}
}
[프로그래머스] 문자열 내림차순으로 배치하기 (0) | 2020.10.17 |
---|---|
[프로그래머스] 문자열 내 p와 y의 개수 (0) | 2020.10.17 |
[프로그래머스] 두 정수 사이의 합 (0) | 2020.10.17 |
[프로그래머스] 나누어 떨어지는 숫자 배열 (0) | 2020.10.17 |
[프로그래머스] 같은 숫자는 싫어 (0) | 2020.10.17 |