Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- react-router
- 항해플러스
- 이코테
- 테코테코
- java
- redux
- 리액트
- react-redux
- 자바
- 알고리즘
- useDispatch
- 프로그래머스
- SW
- 코딩테스트합격자되기
- 매일메일
- maeil-mail
- redux-toolkit
- C++
- react
- Get
- createSlice
- Python
- axios
- programmers
- Algorithm
- 항해99
- json-server
- JavaScript
- redux-saga
- sw expert academy
Archives
- Today
- Total
Binary Journey
[프로그래머스] 파일명 정렬 본문
반응형
출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges
import re
def solution(files):
reg = [re.split(r'(\d+)', s) for s in files]
reg.sort(key = lambda x: (x[0].lower(), int(x[1])))
return [''.join(s) for s in reg]
[프로그래머스] LEVEL2 파일명 정렬 (Python)
프로그래머스 알고리즘 풀이
velog.io
참고: https://stackoverflow.com/questions/430079/how-to-split-strings-into-text-and-number
How to split strings into text and number?
I'd like to split strings like these 'foofo21' 'bar432' 'foobar12345' into ['foofo', '21'] ['bar', '432'] ['foobar', '12345'] Does somebody know an easy and simple way to do this in python?
stackoverflow.com
반응형
'프로그래머스 > level 2' 카테고리의 다른 글
[프로그래머스] 방문 길이 (0) | 2022.01.04 |
---|---|
[프로그래머스] 방금그곡 (0) | 2022.01.04 |
[프로그래머스] 압축 (0) | 2021.12.28 |
[프로그래머스] 가장 큰 정사각형 찾기 (0) | 2021.12.27 |
[프로그래머스] 구명보트 (0) | 2021.12.20 |