← Barclays questions
CodingReported in a candidate post, Sep 2020

Min and Max amount to buy candies with a free offer

Filed under Barclays

Given the prices of N different candies and an offer where buying a candy allows you to take up to K other candies for free, find the minimum and maximum amount of money required to buy all N candies.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Barclays questions

Collected from public candidate posts and coding forums. Updated Nov 2026.