Game of Friends
CodeChefOpen on judge ↗
Karan and Watan are playing a game. The rules of the game are as follows. Initially they have a string of size N consisting of lowercase English characters only. Karan makes the first move and they play alternatively. On each turn, a player can remove one character from the string. The game ends when the remaining string doesn't have any duplicate element (see sample). The player who cannot make 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