Hi, your code doesn’t run for the sample test cases. Your solution with test case : Solution
You are using %s instead of %c for taking input a character so it doesn’t work correctly and displays 1 only. Also, on changing it to %c, the answer for the last case is 4 but your code gives 1(for the last sample input case).
Link after changing %s to %c --> Solution 2
Thanks for enlightening. I corrected that but still WA! Here’s the code : click here .
Hi, your code gives WA for the test case:
Thanks a ton.