← All problemsSign in

Mr X and Challenge

As usual, our Mr. X was challenged by Mr. Z and he asks you to help him out by solving this problem. bool ok(string s , int n) { set mset; for(int i = 0; i = ( (n >> 1) + (n & 1) )   && rekt)    { return 1; } return 0; } Mr. Z will give him all the possible strings of length n having only lower case alphabets 'a' - 'z'. He will pass each of the string given by Mr. Z to the above function

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