← All problemsSign in

Buying Cats

3 Cats Praveen likes cats very much that he went to cat market to buy 3 beautiful cats. There are N cats in the cat market and there are M friendships among the cats. There is a problem that if he has to buy cats that like each other, or else the cats will fight. Each cat has a cost and got confused and opened "how to buy cats at minimal cost" in youtube. You are at his rescue , you have to

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