← All problemsSign in

Buying Items

There are two shops A and B which sales the same type of item at different cost.Ai and Bi denotes the cost of ith item of shop A and B respectively.If cost of ithitem is same at both the shops then he buy that item from shop A.Chef has to buy all the type of items from these shops at minimum possible cost.Find the minimum cost required to buy all type of items. Input First line contains N numb

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