Oracle Interview Question

Phone: Taxproblem and optimized to O(1) after 3 iterations