The easiest way to reduce the time complexity is to avoid a for loop whenever possible. Ideally, you may want to check the time complexity of time Python functions you use, and refactor your code by selecting the less complex functions.