← All problemsSign in

Chef and Laptop

Chef goes to the market to buy a laptop. He enters a shop which has n laptops on display. Cost of ith laptop is c[i]. Chef wants to buy a single laptop by paying least amount of money. But there is an issue: when there are two or more laptops available at the same cost, he gets confused about which one he should buy, so in turn, he can't buy any of those. Find the minimum amount of money he need

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start