LC Study Flashcards
- Word Break
to get runtime complexity, count non-leaf nodes similar to decode ways, easier tho runtime recursion brute-force: 2^n. with memo: O(n)
- Maximum Product Subarray
holy fuck… i got
- Set Matrix Zeroes
look at submission
- Find K Closest Elements
e
237 Delete Node in a Linked List
have to set the next to null, if you want to remove a node. “node = null” does not work bc “node” is just a var and doesn’t alter the actual object, ~duh~. Could have used only two lines and no loop… silly boy..
- Path Sum
DEFINITION OF ROOT-LEAF. IF THERE EXISTS ANOTHER CHILD, IT IS NOT A LEAF
- Permutation in String
e
- Task Scheduler
2 diff ways with pri queue Do the calculation way
- Combination Sum
-best way to find how to get to target
- Binary Tree Level Order Traversal
bfs
- Sort List
e
- Maximum Binary Tree
difficult
- K Closest Points to Origin
e
- The Skyline Problem
e
- House Robber II
e
- Sort Characters By Frequency
e
- Binary Search Tree Iterator
e
- Merge Intervals
interesting, reference the result array to make decisions and update, idk nothing to say
- Decode Ways
the zero case is absolute asshole not dealing with this,….. you need to have the index represent the length or you will kys aids
- Alien Dictionary
e
- Intersection of Two Arrays
e
- Fizz Buzz
e
- Reverse Nodes in k-Group
Use ‘nxt’ for next node name!
- Clone Graph
submitted: both dfs and bfs solutions