CHEFSPL - Editorial

Simple string processing…MySolution

thought the same way nice question
https://www.codechef.com/viewsolution/9578821

It was so easy to miss the obvious with this problem. It is unsurprising that the test cases were initially inadequate. The note from the editorial made my error apparent to me:

"Note: We also return false when n == 0 because W must be nonempty from the definition!"

1 Like

Can someone please help me and tell where is the problem in my code?

I am getting WA for last test cases of both sub tasks.

same logic but got wrong answer!!!
https://www.codechef.com/viewsolution/9674515

The test were still weak even after changes.
Here’s my solution
CodeChef: Practical coding for everyone .
I have done hashing and used the concept that the count of only one element %2 should be 1 and then i applied the condition that if has[element]>=100 printf(“YES\n”), otherwise copied the string into other string without copying one character of this has[element] one by one and applied the formula for even number of characters.
Still my code got accepted!!..

4 Likes

https://www.codechef.com/viewsolution/9678465

can anyone tell me for what testcase this fails ??
because it works for every testcase i can think of and get only the last testcase of second subtask wrong

can any one please tell me where My Solution is failed

Very easy problem. Consider all the possible cases. Check out my sol CodeChef: Practical coding for everyone

Getting a wrong answer for my solution :https://www.codechef.com/viewsolution/9683501...dono for what it fails!
Can someone look at it?

Shouldn’t it be subsequence instead of substring since we are checking for the same ordered sequence of characters rather than the contiguous characters?.

I tried all test cases given in the comments… My code gives correct answer for all of them, but it fails for last test case in both sub tasks. Can someone please check what the error is in my code.? https://www.codechef.com/viewsolution/9688335

Thanks in advance…

can someone plz post the testcases . i have written the code but ans is always showing to be wrong!!
here is the link to my code !

i dont get why codechef submission is always wrong!!

did you consider the case where all characters are same? like a, aa, aaa.
answer should be:
NO
YES
YES

2 Likes

it fails for a. I guess tis is where I went wrong. Thank you, Shadek

Try this

1

cxccc

Answer - YES

Yes, that’s right. I forgot that it should be subsequence. I have updated the editorial. Thanks for pointing it out!

corrected the error
https://www.codechef.com/viewsolution/9685962
still not working

Nice editorial. Breaking and showing all the operations in the form of functions will definitely inculcate better coding practices among the newbies

2 Likes

@s_verma

What logic did you use.