- Greedy Approach
- Simplify, adapt and solve strategy
- Can you solve a simpler version? i.e. if finding the second largest, can you solve for finding the largest?
- Break things down into cases.
- "Runners" techique
- can be used to get O(1) space
- "slow" and "fast" runners/pointers can be used to detect cycles
- How to traverse sections of a string given:
- for i in range(len(str) - len(word) + 1): window = s[i:i + len(word)]
- How to iterate up to length of array/string then reset:
- array[(idx - 1) % array.length]
- Python modulo operator on negative numbers:
- -5 % 4 = 3
- Reverse Polish Notation
- Use stack; when encounter value, add to stack; when encounter operator, pop last two items as terms on operator, then push result onto stack
- Return last item in stack