Amazon Interview Question

Can you solve the question in O(n)?

Interview Answer

Anonymous

Apr 2, 2025

I said yes and provided a better solution