Make All Same
CodeChefOpen on judge ↗
The chef is fond of playing games and excels in them by winning. Today chef has found a game in which he has to convert any binary string into a palindromic string. The game has certain rules. In one operation, Chef will choose different indices i, j and then do one of the following - replace **arr[ i ]** with xor of **arr[ i ]** and **arr[ j ]** - or replace **arr[ j ]** with xor of **arr[ i ]*
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