Compute final prices with next smaller discount | Uber Interview Question