
문자열 내 마음대로 정렬하기
def solution(strings, n):
a = []
for word in strings:
a.append((word[n], word))
a.sort()
return [tuple[1] for tuple in a]
다른사람 풀이
def strange_sort(strings, n):
return sorted(strings, key=lambda x: x[n])
strings를 정렬해. 근데 키는 단어의 n번째 알파벳으로 해
너무 깔끔하다👍
ㅇ
.