Lists are a fundamental data structure for any program. When faced with a technical interview problem using lists, here are a few strategies to keep in mind:
num % length_of_list).
O(logN)time using binary search.
Run the code to see the difference in execution speed between optimal and naive solutions!
Sometimes the solution which optimizes for space will run slower.