반응형
문제
https://school.programmers.co.kr/learn/courses/30/lessons/12915
문제 풀이
n번째 인덱스, 사전순 정렬
코드
def solution(strings, n):
return sorted(strings, key = lambda x: (x[n], x))
반응형
'알고리즘 > 프로그래머스 문제풀이' 카테고리의 다른 글
[프로그래머스] lv.1 이름이 있는 동물의 아이디 sql 풀이 (0) | 2023.10.17 |
---|---|
[프로그래머스] lv.1 크기가 작은 부분문자열 python 풀이 (0) | 2023.10.16 |
[프로그래머스] lv.1 k번째 수 python 풀이 (0) | 2023.10.16 |
[프로그래머스] lv.1 제일 작은 수 제거하기 python 풀이 (0) | 2023.10.15 |
[프로그래머스] lv.1 3진법 뒤집기 python 풀이 (0) | 2023.10.15 |