leetcode
leetcode copied to clipboard
👏🏻 leetcode solutions for Humans™
globalSet这块看了下答案,没完全写对,再刷一次 ```python class Solution(object): def lengthOfLongestSubstring(self, s): globalMax = -float('inf') globalSet = set() j = 0 for i in range(len(s)): while j < len(s) and s[j] not in globalSet: globalSet.add(s[j])...
* [ ] 1146. Snapshot Array
Day 6
## Week 2 | Day 6 ### Goal #### DFS / Backtracking ### Leetcode - [x] 301 Remove Invalid Parentheses - [x] 78. Subsets - [x] 567. Permutation in String...
#### 116 | Populating Next Right Pointers in Each Node #### BFS Solution ```python class Solution(object): def connect(self, root): if not root: return queue = [root] while queue: curr =...
98 Validate BST * 7 https://leetcode.com/problems/validate-binary-search-tree 977 Squares of a Sorted Array *2 https://leetcode.com/problems/squares-of-a-sorted-array 140 Word Break II * 2 https://leetcode.com/problems/word-break-ii 29 Divide Two Integers *4 https://leetcode.com/problems/divide-two-integers 246 Strobogrammatic Number...
## Week 2 | Day 1 ### Goal * Focus on High Freq Qs #### 560. Subarray Sum Equals K (x7) - [ ] 560. Subarray Sum Equals K >...
### 560. Subarray Sum Equals K ```python ''' 不懂的可以参考: https://leetcode-cn.com/problems/subarray-sum-equals-k/solution/hot-100-he-wei-kde-zi-shu-zu-python3-cong-bao-li-j/ [1:29] Start Thought Process 1. [Brute Force] for i -> n for j -> (i, n) find sum of nums[i:j...