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