Mr Swegwan and His GirlFriends
CodeChefOpen on judge ↗
Now you must have come across the ‘sweg’ of Mr. Swegwan, so is the case with girls. So it is pretty obvious that he has many girlfriends. But Mr Swegwan is a very busy man and does not talk to all of his girlfriends at the same time. He stores the information about which girlfriend to talk to and which girlfriend to not talk to, in a string (1 indexed). Also he has assigned a unique id to each of
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