ClearMotion interview question

How would you optimize the time complexity of your algorithm?