Compute discounted prices and full-price indices | Microsoft Interview Question