Minimum Cost to Buy M Items

Asked at Amazon · Coding Questions · Difficulty: Medium

There are `n` item types with infinite supply; the `j`-th item bought of type `i` costs `a[i] + (j - 1) * b[i]`. Determine the minimum total cost to buy exactly `m` items.

Loading the problem…