본문 바로가기

Scribbling

검색하기
Scribbling
프로필사진 focalpoint

  • 분류 전체보기 (407)
    • Computer Science (392)
      • C++ (38)
      • Coding Test (225)
      • Algorithms & Data Structure.. (44)
      • Computer Knowledge (25)
      • Python (32)
      • Java (19)
      • Data Science (6)
      • Basics of Basics (2)
      • ETC (0)
    • Knowledge Repo (4)
      • Quant (1)
      • RF (3)
    • Hobby (9)
      • News Critic (5)
      • Diary (2)
      • LOL (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • Git
  • Portfolio
  • LinkedIn
«   2026/01   »
일 월 화 수 목 금 토
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 31
Tags
  • Convert Sorted List to Binary Search Tree
  • Python Implementation
  • LeetCode
  • Generator
  • Substring with Concatenation of All Words
  • Python Code
  • 시바견
  • DWG
  • 109. Convert Sorted List to Binary Search Tree
  • 컴퓨터의 구조
  • kaggle
  • data science
  • t1
  • 315. Count of Smaller Numbers After Self
  • 프로그래머스
  • iterator
  • attribute
  • 30. Substring with Concatenation of All Words
  • concurrency
  • Protocol
  • Regular Expression
  • Decorator
  • 715. Range Module
  • 밴픽
  • 43. Multiply Strings
  • 파이썬
  • 운영체제
  • shiba
  • Class
  • Python
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Gray code (1)

Scribbling

LeetCode: 89. Gray Code

n = 0 n = 1 n=2 n = 3 000 001 101 1100 100 1101 1001 1000 e.g. n=3 -> 100 + 1000, 101 + 1000, 001 + 1000, 000 + 1000 -> 역순 + 2의 n-1승 class Solution: def grayCode(self, n: int) -> List[int]: ret = [0] for i in range(n): ret += [x + pow(2, i) for x in reversed(ret)] return ret

Computer Science/Coding Test 2021. 10. 8. 15:21
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바