Technics and tips
- Consider searches within hashmaps
- Consider storing number of ocurrences with hashmaps
- When using recursion consider keeping track of visited paths with an array
- When using recursion consider keeping track of previous scores with an hashmap
- Fast checks for elements of type X via stack (e.g. is there any parking place for buses?)
- Fast lookup if element X via hashmaps (e.g. where is the vehicle with this license place?)
- Sorted arrays lead to binary search (log n - At each step we reduce the seach space by half)
Recursion
- With numbers start from the number and go down to zero.
- Think recursion comming from the base case up to the starting point
Binary search
- Run while start <= finish; after each loop increase start or decrease finish in order to break the initial condition
Test cases to cover
Zero test case
[0,0,0]
Mirror test case
[3,2,1,0,0,1,2,3]
[-3,-2,-1,0,0,1,2,3]
__note 1: before starting solving ask in which direction should your anwser go, Systems Design, Class Hierarchy, etc.
__note 2: show systematic approach, dont just to the solution, make questions and draw assumptions
__note 3: determine bottle necks, data/performance/etc
__note 4: write top 3 unique/selling points, concentrate on those