Minimize operations to reduce price difference | Amazon Interview Question