https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/
BFS, DFS
Two pointers
https://algodaily.com/lessons/using-the-two-pointer-technique https://www.freecodecamp.org/news/greedy-algorithms/
Miscommunication and eagerness to write the code - are two pinnacles of failure for knowledgeable and experienced engineer. We will fight it. Here is the process, which we propose to eliminate the risks as much as possible.
- Write comments
- WRITE IT DOWN
- WRITE IT DOWN
- Ask should you care about ordering and null values, or any other special cases - ask to simplify it
- Might help you right away
- Does it reassemble any data structure?
- Does it look like an LL/Hashmap/Tree/Graph/Queue/Deque?
- Propose one option briefly
- If no signals will be apparent from an expert - proceed
- Check for any signals
- Select the easiest one
- Option: write down the process
- Example 1
- s = "aBcde", curr = "a"
- curr = "a" ? lower case => "a"
- curr = "B" ? not lower case => "b"
- Option: Estimate the complexity - compute and memory
- Will you need a depth-first search? Sliding window? Divide and conquer? Something else?
- Stuck? Review the requirements, re-read it once again
- Need to decrease the complexity? Think about additional memory usage - hashmap, stacks
- Option: Estimate the complexity - compute and memory
- Validate with an expert
- Since the approach, algorithm, and data are approved, it should take the least amount of time
- Can't recall a function? Ask, or create a placeholder!
- Bugs? Use prints to debug it!
- Too many prints? Always add an incremental ID to it - quick and easy