| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 링피트
- 뭐든
- Daily Challenge
- 미드시청
- 30분
- 운동
- 스탭퍼
- 영어공부
- English
- 사이드
- 개발자
- 리얼 클래스
- 읽기
- 쓰릴오브파이트
- realclass
- Writing
- 프로젝트
- leetcode
- 월간
- 잡생각
- FIT XR
- 영어원서읽기
- 3줄정리
- 만화도
- Problem Solving
- 괜찮음
- 화상영어
- 파비최
- 10분
- 매일
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/
Partitioning Into Minimum Number Of Deci-Binary Numbers - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
엄청 간단하게 풂. (물론 효율은 하위 5%)
그냥 문제와 예를 잘 읽어보면, 전체 숫자 중에 가장 큰 값을 출력해주면 됨.
class Solution:
def minPartitions(self, n: str) -> int:
res = 0
for nn in n:
res = max(res, int(nn))
return res
그냥 list(map) 써서 개선했더니 하위 30%로 올라감
class Solution:
def minPartitions(self, n: str) -> int:
return max(list(map(int,n)))반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
| Today's Challenge (0) | 2022.06.29 |
|---|---|
| Today's Challenge (0) | 2022.06.28 |
| Today's Challenge (0) | 2022.06.26 |
| Today's Challenge (0) | 2022.06.25 |
| Today's Challenge (0) | 2022.06.24 |
Comments