i want to discusss my approach on this question as it is giving wa but i am not able to find where i am wrong. if someone willing to help pls reply
this is my solution
for input : a
the only substring you can pick is βaβ itself , in that case answer should be βzβ (after shift) , but your program prints βaβ only , try to debug this first
1 Like
thanks i have debug it i got the missing case but now it is showing tle. i have done using one traversal only
s1=s1+x
takes O(n) time. You need to use a stringbuilder.
1 Like
thanks bhai got it. i follow you on youtube and also on linkedin. Thanks for help
1 Like
youβre welcome man , and good luck for next problems
1 Like