Please read the new rule regarding the restriction on the use of AI tools. ×

ivane_shubham's blog

By ivane_shubham, history, 6 years ago, In English

I am solving this problem but I am getting wrong answer on test case but I am running on my computer it is working please help my source code.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I tested your code on my computer and it didn't work, but when I initialized the variable j it worked, so I think that's the problem.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

also your condition is wrong instead of i<n it should be j<n