일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 43. Multiply Strings
- 밴픽
- 315. Count of Smaller Numbers After Self
- 30. Substring with Concatenation of All Words
- Regular Expression
- Generator
- kaggle
- 컴퓨터의 구조
- data science
- Python Implementation
- Python
- iterator
- 715. Range Module
- Protocol
- Convert Sorted List to Binary Search Tree
- Python Code
- Substring with Concatenation of All Words
- LeetCode
- concurrency
- 시바견
- attribute
- 프로그래머스
- shiba
- Class
- DWG
- 109. Convert Sorted List to Binary Search Tree
- t1
- Decorator
- 운영체제
- 파이썬
Archives
- Today
- Total
목록65. Valid Number (1)
Scribbling
LeetCode: 65. Valid Number
First solution is using regular expression. Below is some useful patterns. Integer: ^[+-]?\d+$ Flaot: ^[+-]?((\d+(\.\d*)?)|(\.\d+))$ Sicnetific notation: ^[+-]?((\d+(\.\d*)?)|(\.\d+))[eE][+-]?\d+$ class Solution: def isNumber(self, s: str) -> bool: import re pat = re.compile('(^[+-]?((\d+(\.\d*)?)|(\.\d+))$)|(^[+-]?((\d+(\.\d*)?)|(\.\d+))[eE][+-]?\d+$)') return re.match(pat, s) Second solution i..
Computer Science/Coding Test
2022. 1. 20. 14:20