Debug my code please

Question-:FRUITS Problem - CodeChef
code-:CodeChef: Practical coding for everyone

Use k - - instead of k++

Have you tried debugging it at all? It goes into a long loop with the sample testcase:

for(int i=k;k>=1;k++)

(It’s going to take a long time for k to become < 1).

Edit: Depending on your compiler, it might never do.

2 Likes

And use variable j for inner loop because using i for nested loops might cause problems for the code to work

I am sorry…I didn’t check the program correctly… :sweat_smile:

Based on the timing of your submission and posting this thread, it looks like you didn’t check it at all :slight_smile:

I don’t mean to be rude, but please do so before posting a thread. If you immediately ask for help on the forums without even trying to figure out what’s going on yourself, how will you mprove?

2 Likes

I do check sir… sometimes I get stuck for a couple of days and then I ask but this question was simple that’s why I asked so early…because I got a little frustrated :sweat_smile:

1 Like