Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- 파이썬
- 금융문자분석경진대회
- dacon
- 우분투
- 맥북
- Git
- Real or Not? NLP with Disaster Tweets
- programmers
- 프로그래머스
- 자연어처리
- hackerrank
- 코로나19
- ubuntu
- leetcode
- 편스토랑 우승상품
- Docker
- SW Expert Academy
- 프로그래머스 파이썬
- 데이콘
- 캐치카페
- gs25
- github
- Kaggle
- ChatGPT
- 더현대서울 맛집
- 편스토랑
- 백준
- AI 경진대회
- Baekjoon
- PYTHON
Archives
- Today
- Total
목록
반응형
386. Lexicographical Numbers (1)
반응형
솜씨좋은장씨
[leetCode] 386. Lexicographical Numbers (Python)
Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algorithm to use less time and space. The input size may be as large as 5,000,000. Solution class Solution: def lexicalOrder(self, n: int) -> List[int]: my_nums = [str(i) for i in range(1, n+1)] my_nums = list(sorted(my_nums)) return my_nums SOMJANG/CODI..
Programming/코딩 1일 1문제
2020. 7. 22. 22:37
반응형