sorted(bca) -> abc || keys = [0,1,0....0], len(keys) = 26
two pointer
Arrays.sort(intervals, new Comparator<int[]>(){ public int compare(){}})
Input can be a streaming of data (access with get() method) instead of a list, or divide & conquer
921, 1514 minimum inserts to make valid (), stack or one pass sol
42 & 84, care about condition of pushing to stack
- BalancedBinaryTree 110
- BoundaryOfBinaryTree 545
- FlattenBTtoLinkedList 114
- FindCommonAncestorOfBinaryTree 235 236
BST -> BT -> N-ary Tree
694-221
TLE, tree dp + purning TBF, undirected graph
DAG, states: {unvisted, visiting, visited}
DAG
- BinaryTreeRightSideView 199
- WordLadder
- Shortest Distance from All Buildings
- Shortest Path with Obstacle Elimination
- Amazon Locker
- Alien Dictionary
BFS in DAG, Toposort, course schedule emmm
sorted or not, res[:] or res
dp[i,j]: LCCA of A[:i] and B[:j], dp[i,j] = dp[i + 1][j + 1] + 1 if A[i] == B[j]
dp[i,j]: LISS of nums[i:j], dp[j] = max(dp[j], dp[i] + 1) if nums[i] < nums[j]
dp[i]: s[:i] is workbreakable, dp[j] = dp[i] if A[i:j] in wordDict, 140 TLE
dp[i,j]: number of operations from wordA[:i] to wordB[j:]. dp[i][j] = dp[i - 1][j - 1] if wordA[i] == wordB[j], dp[i][j] = 1 + max(insert, delete, swap)
If it's how random.shuffle() implemented
- Floyd's Cycle Detection
- Garbage Collection in Java
- QuickSort
- KMP TBR
- BinarySearch
- MergeSort
- CountSort
- FuzzySort
- Queen's Gambit'
- LRU Cache
- Random Number Generator
- Median from Data Stream 295
- Top K Frequent from Data Stream
- ParkingLot
- Java Interface & Abstract class
- Templates
- Functor
Key Bindings | Pattern
Jump based on relativenumber | <number><direction>
Visual mode: 5j(jump down 5 lines), 3i(jump up 3 lines), very helpful when enable 'set relativenumber', (no ruler plz)
Execute program within editor | <shift> + ':' + '!' + <command>
Sometimes I need to :wq and run some program and go back to editor, but !<command> helps run program within vim. If <command> is empty, :! will simply run last command
Comment / Uncomment multiple lines
<control> + v: enter visual mode, <esc> + v may not work, it will select blocks of lines instead of first column in the next step
Select the lines that you want to comment / uncomment
Comment: <shift> + i: Enter the insertion mode, type the comment sign: #, // etc. Then <ESC>
Uncomment: d
Navigate between file structure and file content
vim . in current directory
:NERDTree
<control> + w(double click) to navigate between windows
Userful Plugins:
gmarik/Vundle.vim: Best package manager for lazy people(maybe?)
preservim/nerdtree: File structure and menu bar
Valloric/YouCompleteMe: Finally works in macos 10.14
zxqfl/tabnine-vim: Neural Network + YouCompleteMe, but slows vim down
morhetz/gruvbox: Best color scheme for py i guess? not suitable for cpp though
- Marasy Playlist
- [Gurenge Animenzzz] (https://www.youtube.com/watch?v=NQMmZ4Psb7w)
- You Lie in April
- Shining/Snow-Rain
- Lemon
- からくりピエロ
- Karakuri Pierrot
- BigYear
- Unravel
- Sik-K
- Guren no Yumiya
- Never Grow Up
- YOASOBI
- Goose House (Uncle A)
- Ignite
- Angel
- Sanbonezakura
- Loser
- Honey
- Way back home
- Lemon
- Brave Heart
- Light of the Seven
- Anime OP Combo
- AOA OP Combo