WA for STEM.What is the glitch in logic?

I’m getting wa for this solution to STEM problem of October COOK-OFF.
Solution Link : JAVA

well , you asked for the glitch in logic so you should explain your logic first so that it becomes easy for anyone to help you out :slight_smile:

1 Like

Output for :

10

4

asdf sagh asjk sart

your code gives ‘s’ but ans is ‘a’ that’s why WA…!!

1 Like
//