946 Validate Stack Sequences
Link: validate stack sequences Thought Its pretty straight forward, just stimulate a stack and push/pop as the sequence shows. Code […]
Link: validate stack sequences Thought Its pretty straight forward, just stimulate a stack and push/pop as the sequence shows. Code […]
Link: Bag of Tokens Thought For this question, I find we could do 2 things: spend any cost form the
Link Minimum Increment to Make Array Unique Thought Firstly, I try to enumerate all existing number, and I got TLE
link: Minimum Area Rectangle Thought I plan to use sweep line to solve. Firstly I put a dictionary with x-val
link: Range Sum of BST Thought When first saw this question, I think using tree traverse could solve it and
link Distinct Subsequences II Thought The very first thought here is use DFS to find all distinct subsequences. However it
link: Number of Recent Calls Thought Question ask for numbers of calls in 3000. So sliding windows is my choice
link Knight Dialer Thought Since it ask how many distinct numbers could be generated, DP jumps to my mind immediately.
link: Shortest Bridge Thought Since the question ask for shortest, so BFS probabely the best algorithms to solve it. But
LinkĀ 931.Minimum Falling Path Sum Thought DFS When first seeing this question, DFS prompt into my mind directly. Take Any node