摘要:Problem Reason Reference Moving ZeroesSort Colors Corner cases Shortest Word Distance Thought: 2 ptr chasing Merge 2 sorted ListsRemove Linked List El
阅读全文
05 2016 档案
摘要:Kruskal Algorithm is based on Union-Find - quite intuitive.
阅读全文
摘要:An intuitive Prim algorithm impl.
阅读全文
摘要:We don't have to keep a complete chess board.. just counters!
阅读全文
摘要:Two tricks here: 1. Counting no. of inversed pairs - using Merge Sort, nothing special 2. How to check 'chaotic'? We simply check if any number is ove
阅读全文
摘要:A typical solution is heap based - "top K". Complexity is O(nlgk). There is a O(n) one indeed - bucketing the frequencies.https://leetcode.com/discuss
阅读全文

浙公网安备 33010602011771号