Description Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Answer class Solution: def addBinary(self, a: str, b: str) -> str: i = int(a,2) j = int(b,2) # ans = i+j # return bin(ans)[2:] return format(i+j,'b') 진수 변환 >> bin(30) '0b1110' >> oct(30) '0o36' >> hex(30) '0x1e' Format 함수 # 접두어 제외하기 >> format(0b..
Development/Algorithms
2020. 6. 7. 21:30
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- error
- 책리뷰
- lllm
- 키보드
- docker
- K8S
- AWS
- kubens
- leetcode
- book
- Binary
- Shell
- Gemma
- palindrome
- feed-forward
- 한빛미디어
- kubernetes context
- csv
- Algorithm
- Container
- Git
- 파이썬
- Fine-Tuning
- go
- LLM
- 나는리뷰어다
- Kubernetes
- collator
- Python
- BASIC
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
반응형