WA in Chef and notebooks

[CodeChef: Practical coding for everyone]
This is my solution. Please tell me what is wrong in this.

Please indent your code properly. My post was wrong.

2 Likes

I think that’s not the case - it just looks like it is because the indentation is so screwy :slight_smile: He reads in all the input for a testcase and then, after that, he performs a single search through it.

That part’s actually fine - it’s the fact the he’s reading in n and k in the wrong order that’s the problem :slight_smile:

4 Likes

Yikes, I made a lot of mistakes. This is what happens when I try to read unindented code.

2 Likes

Yet more evidence for your assertion, here :slight_smile:

3 Likes

thanks a lot! Got it! I’m a beginner and I’ll keep indentation in mind.

1 Like