Tom and Jerry Rivalry
CodeChefOpen on judge ↗
To end the rivalry between Tom and Jerry completely, Tom has come up with an idea. Instead of defeating Jerry all by himself, he has gathered $R - L +1$ cats to help him in defeating Jerry. He has numbered them from $L$ to $R$ (each cat gets a unique number). After numbering the cats, some of the cats refused to work with each other as they didn’t get the desired number. Cats agreed to work as a
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.
Sign in to chat with the tutor and save your progress.
Sign in to start