| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- Mesh
- 오블완
- 자료구조
- CNN
- Data_Structure
- Database
- 데이터
- LeetCode
- 개발자
- DS
- sort
- 코딩테스트
- CS
- GNN
- Leet Code
- Python
- 데이터베이스
- db
- 티스토리챌린지
- 컴퓨터사이언스
- adaptive remeshing
- code
- SQL
- meshgraphnet
- 대학생
- coding
- 데베
- mysql
- 컴퓨터공학
- 코테
- Today
- Total
목록Leet Code (6)
sy1214ei 님의 블로그
https://leetcode.com/problems/keyboard-row/description/level : easyclass Solution: def findWords(self, words: List[str]) -> List[str]: set1 = {'q','w','e','r','t','y','u','i','o','p'} set2 = {'a','s','d','f','g','h','j','k','l'} set3 = {'z','x','c','v','b','n','m'} res = [] for i in words: wordset = set(i.lower()) if (wordset&se..
level : Mediumclass Solution: def lengthOfLongestSubstring(self, s: str) -> int: """ 슬라이딩 윈도우 - 부분 문자열에 중복 문자 X: end += 1 - 부분 문자열에 중복 문자 O: start += 1 """ max_len = 0 start, end = 0, 0 chars = set() while end
https://leetcode.com/problems/intersection-of-two-arrays/description/level : Easyclass Solution: def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]: """ 1. nums1에 있는 값은 모두 True 2. nums2에 nums1에 있는 값이 있다면 res.add 3. return list(res) : res에는 num1, num2의 겹치는 값들 다 들어감 """ hash_table = {} for num in nums1: hash_table[num..
https://leetcode.com/problems/longest-palindrome/description/Level : EasyTopics : Hash Table | String | Greedyclass Solution: def longestPalindrome(self, s: str) -> int: # "abccccdd" -> "dccaccd" "dccbccd" # 해쉬테이블로 각 char타입의 수를 count 해준다. # 각 문자별 저장되어있는 count가 짝수이면 -> length로 모두 사용 # count가 홀수이면 -> count-1만큼 length로 사용 char_cnt = {} ..
https://leetcode.com/problems/two-sum/description/Level: EasyTopics: Array | Hash Tableclass Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: """ 1. for i, num in enumerate(nums) : 뭔가 순회를 해야 찾든말든 할것임 2. 우리가 찾는 것 find = target - num 3. 만약 hash_table에 find가 있다면 return 4. hash_table[num] = i """ hash_table = {} for i, ..
https://leetcode.com/problems/palindrome-number/description/Level : EasyTopic : Mathclass Solution: def isPalindrome(self, x: int) -> bool: # 음수라면 False # 0이라면 true # 양수라면 # 1. 한자리수 -> true # 2. not 한자리수 # n = len(str(x))//2 -> 반복문을 n번 돌며 앞뒤가 다르면 false 같으면 반복문 계속돌기 if x