reduce potential time complexity