Can somebody give me a hint on how to
solve the problem CodeChef: Practical coding for everyone ?
Thank you very much.
There are two possibilities of having SS after concatenating n times :
- SS between 2 and s.size() ( example : PLEASS or PLSSEA or SSPLEA) --> count += ?
- first character S and last character S ( example : SPLEAS )-- > count += ?
Do these two and you will get the answer
1 Like
I don’t think it is that simple.
I just had a look at your solution to this problem. It says it passed all the test cases. However, when I run your code with the following as input,
1 1 SSSSSS
Your code gives output 5, but clearly the answer is 3, right?
Did I understand the question wrong?
Answer is “5”.
SSSSSS:- “SS”,“SS”,“SS”,“SS”,S"SS" . In total 5-places where we find “SS”.
1 Like
Wow… I should have reread the question.
1 Like