| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- leetcode
- 화상영어
- 링피트
- Writing
- 운동
- Problem Solving
- 뭐든
- 영어원서읽기
- 월간
- 리얼 클래스
- 10분
- 매일
- 파비최
- 잡생각
- 사이드
- 괜찮음
- 쓰릴오브파이트
- Daily Challenge
- 개발자
- 읽기
- FIT XR
- 스탭퍼
- English
- realclass
- 프로젝트
- 30분
- 3줄정리
- 미드시청
- 영어공부
- 만화도
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/power-of-three/submissions/
Power of Three - 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
오늘도 easy 난이도 문제.
생각보다 따질 조건들이 몇개 있음.
class Solution:
def isPowerOfThree(self, n: int) -> bool:
if n == 1:
return True
if n < 3:
return False
while n > 1:
if n % 3 != 0:
return False
n //= 3
return True반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
| Today's Challenge (0) | 2022.08.26 |
|---|---|
| Today's Challenge (0) | 2022.08.25 |
| Today's Challenge (0) | 2022.08.23 |
| Today's Challenge (0) | 2022.08.22 |
| Today's Challenge (0) | 2022.08.21 |
Comments