← All problemsSign in

Pet Store

CodeChefRating 1126Open on judge ↗

Alice and Bob went to a pet store. There are $N$ animals in the store where the $i^{th}$ animal is of type $A_i$. Alice decides to buy some of these $N$ animals. Bob decides that he will buy **all** the animals **left** in the store after Alice has made the purchase. Find out whether it is possible that Alice and Bob end up with **exactly same** [multiset](https://en.wikipedia.org/wiki/Multiset)

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