Amazon Interview Question

write algorithm for a calculator