add strings1 코딩테스트 연습(leetcode #231, #202, #415) 231. Power of Two( https://leetcode.com/problems/power-of-two/ )- 내가 작성한 코드(runtime : 41ms, memory: 16.46MB)class Solution: def isPowerOfTwo(self, n: int) -> bool: self.solution = [2**x for x in range(32)] if n in self.solution: return 1 else: return 0- 교수님 코드1(runtime : 36ms, memory: 16.51MB)def solution1(n): if n == 0: return False # 2의 배수와 2의 제곱수 .. 2024. 6. 10. 이전 1 다음