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
- Baekjoon
- 캐치카페
- hackerrank
- github
- dacon
- ChatGPT
- 파이썬
- 코로나19
- 백준
- 데이콘
- AI 경진대회
- 프로그래머스
- 편스토랑 우승상품
- Docker
- 자연어처리
- Kaggle
- 맥북
- PYTHON
- 프로그래머스 파이썬
- ubuntu
- Git
- 우분투
- leetcode
- programmers
- 편스토랑
- SW Expert Academy
- Real or Not? NLP with Disaster Tweets
- 더현대서울 맛집
- gs25
- 금융문자분석경진대회
Archives
- Today
- Total
목록
반응형
Power of Two (1)
반응형
솜씨좋은장씨
[leetCode] 231. Power of Two (Python)
Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 Output: false Solution class Solution: def isPowerOfTwo(self, n: int) -> bool: answer = False pow_2s = [] for i in range(50): pow_2s.append(pow(2, i)) if n in pow_2s: answer = True return answer ..
Programming/코딩 1일 1문제
2020. 7. 12. 00:38
반응형