1. clarify requirements: input, output
2. clarify edge cases: max INT, empty input, throw exception?
3. design algorithm: which data structure/api can be used? assumptions?
4. confirm time complexity and space complexity requirement

Advertisements