- product development
- API and typescript
- some reading on improving health
- listening to a podcast on ADHD
It's hard to put my capabilities in a resume...
- product development
- API and typescript
- some reading on improving health
- listening to a podcast on ADHD
It's hard to put my capabilities in a resume...
The optimal solution is simply "walk" through the path until hitting a decision point. My solution is obviously too tricky for both compute time and storage time. #leetcode #python
Was kinda forced to do lc because I can't tutor my friend.
leetcode.com/problems/res...
2373. Largest Local Values in a Matrix - #Python | 26 ms, 18.4 MB leetcode.com/problems/lar...
With #leetcode and interviews, I wonder if it's just a mental block. My brilliant friends just cannot overcome it.
leetcode.com/problems/res...
2373. Largest Local Values in a Matrix - #Python | 26 ms, 18.4 MB leetcode.com/problems/lar...
With #leetcode and interviews, I wonder if it's just a mental block. My brilliant friends just cannot overcome it.
The solution is the same as checking if a graph is a DAG (directed acyclic graph). I was surprised my original solution exceeded the time limit - I needed to clear the children to be explored to save intermediate result. #python #leetcode #neetcode75
The solution is the same as checking if a graph is a DAG (directed acyclic graph). I was surprised my original solution exceeded the time limit - I needed to clear the children to be explored to save intermediate result. #python #leetcode #neetcode75
Passing all the test cases and beating only 5% of solutions in runtime is an achievement (memory beat 99% though). Will have to revisit. #python #leetcode #neetcode75
Passing all the test cases and beating only 5% of solutions in runtime is an achievement (memory beat 99% though). Will have to revisit. #python #leetcode #neetcode75
DFS is used to find and make all nodes and then connect all graphs. So runtime should be O(n). Used a map data structure to store the intermediate results to make finding each node with O(1) computation. #python #leetcode #neetcode75
DFS is used to find and make all nodes and then connect all graphs. So runtime should be O(n). Used a map data structure to store the intermediate results to make finding each node with O(1) computation. #python #leetcode #neetcode75
Used DFS to identify tiles that represent the current "island" and then convert it to "water" to mark that this tile is no longer of interest. O(m*n): m = # of rows, n = # of columns. #python #leetcode. 41 out of #neetcode75. More than halfway done!
Used DFS to identify tiles that represent the current "island" and then convert it to "water" to mark that this tile is no longer of interest. O(m*n): m = # of rows, n = # of columns. #python #leetcode. 41 out of #neetcode75. More than halfway done!
Trie is like a linked list on steroids...
#python #leetcode #neetcode75
Trie is like a linked list on steroids...
#python #leetcode #neetcode75
DFS search. Again, my performance is not great when I track these intermediate steps. I need to read up on backtrack and think about the difference between it and just tree search algorithms.
#leetcode #python #neetcode75
DFS search. Again, my performance is not great when I track these intermediate steps. I need to read up on backtrack and think about the difference between it and just tree search algorithms.
#leetcode #python #neetcode75
I got the recursion part right. Comparing my result to some of the other more efficient solutions, the difference is how the problem is divided into subproblems and track progress. Might redo this problem. #python #leetcode #neetcode75
I got the recursion part right. Comparing my result to some of the other more efficient solutions, the difference is how the problem is divided into subproblems and track progress. Might redo this problem. #python #leetcode #neetcode75
First time using heapq in Python (btw I never took a formal CS class in Python...). I will have to revisit this problem as I did not solve this question independently. Found some nice #python resource: pymotw.com/3/
#leetcode #neetcode75
First time using heapq in Python (btw I never took a formal CS class in Python...). I will have to revisit this problem as I did not solve this question independently. Found some nice #python resource: pymotw.com/3/
#leetcode #neetcode75
For #leetcode hard questions, I believe, "as long as I solve this, even if it's brute force and not the best solution out there, I am golden." Mine's O(mn) solution, where I check for min of each list every time. But heck, I solved a HARD.
For #leetcode hard questions, I believe, "as long as I solve this, even if it's brute force and not the best solution out there, I am golden." Mine's O(mn) solution, where I check for min of each list every time. But heck, I solved a HARD.
Linked list type of problem seems to have a trend to use 2 pointers. I did peek into the hint section and solved this one in O(n) within 10 minutes (definitely a record).
#python #leetcode #neetcode75
Linked list type of problem seems to have a trend to use 2 pointers. I did peek into the hint section and solved this one in O(n) within 10 minutes (definitely a record).
#python #leetcode #neetcode75
I brute-forced it with O(n) solution.
1- create a queue that stores all of the nodes - remove all of the links between nodes
2- pop the front and the back of the list to recreate the linked list
Not as elegant. But job done.
#python #leetcode #neetcode75
I brute-forced it with O(n) solution.
1- create a queue that stores all of the nodes - remove all of the links between nodes
2- pop the front and the back of the list to recreate the linked list
Not as elegant. But job done.
#python #leetcode #neetcode75
This is another problem that I might redo. The solution uses 2 pointers approach where slow pointer moves at pace of 1 while fast pointer moves at the pace of 2. Every iteration, the gap between two pointers increases by 1. #python #leetcode #neetcode
Used recursion and achieved the best result. I also did this question in 2020, and the performance is not as great with the 3-pointer approach (my first instinct). My laziness guided me to use recursion. #python #leetcode #neetcode75
Used recursion and achieved the best result. I also did this question in 2020, and the performance is not as great with the 3-pointer approach (my first instinct). My laziness guided me to use recursion. #python #leetcode #neetcode75
Implemented 2 solutions: 1 with recursion and 1 with just 3 pointers (prev, curr, next). Despite the fact that both solutions are O(n), the recursive solution takes much longer in runtime and more memory. #python #leetcode 30/ #neetcode75
Implemented 2 solutions: 1 with recursion and 1 with just 3 pointers (prev, curr, next). Despite the fact that both solutions are O(n), the recursive solution takes much longer in runtime and more memory. #python #leetcode 30/ #neetcode75
To decide which subproblem is worth solving, peek into the first and last number (as this is a rotated ordered list). O(logN).
#leetcode #python #neetcode75
To decide which subproblem is worth solving, peek into the first and last number (as this is a rotated ordered list). O(logN).
#leetcode #python #neetcode75