Algorithm · Instacart · Easy
Write a function total_price_cents(items) that accepts a list of product records. Every record is a single string with four pipe-separated fields: The function must compute the exact total by multiplying the quantity field by the unit price in cents field for each record and adding all those products together. Both quantity and unit price in cents are nonnegative decimal integers. No discounts, taxes, or other adjustments are applied. Return the result as a decimal string.…
Checking your access…