Help required in all substrings
Can someone please help me in figuring out why this code wont accept ?
https://www.codechef.com/viewsolution/26831137
Sorry in advance if it comes out to be a really silly mistake but your answer will definitely help me a lot
s5960r
2
Your Program fails for this test
1
cat
catc
Your Output
ccat
Expected Output
catc
1 Like
Oh right thanks !!!
So I think a check on the second character should work.
1 Like
s5960r
4
If u check second character…Think about this
1
ccat
ccatc
So you can simple generate both possibity and choose the minimum
1 Like
Yeah didnt think about that either. Thanks a lot!! I’ll generate both and compare. Must say good cases on this one
1 Like
s5960r
6
Yup ! I wrote a whole explanation here
1 Like
Yup I read it aweasome explanation just missed that one case during the contest
@s5960r
can u tell me in which test case my program is failing.
https://www.codechef.com/viewsolution/26854922
s5960r
9
@aryankuma0r Your Program fails for this test
1
tvr
tvrt
Your Output
tvrt
Expected Output
ttvr