Click here to Skip to main content
15,908,013 members

Comments by Meghana N.V (Top 2 by date)

Meghana N.V 4-May-23 1:03am View    
I have tried to solve I'm stuck in understanding problem like for inputs like N=2, S=1010
to satisfy the second condition they have swapped indices 0 and 1 so out put is 0110 i.e for i=0 and N=2.
now I have incremented i=1, s[i]=1 and s[i+1]=1(here i satisfy this condition i + 1 % N - (i) % N == 1 ) where 1st condition is not satisfying ryt then why didn't swap.
Meghana N.V 4-May-23 0:55am View    
this question from hacker earth