dorasainath955's blog

By dorasainath955, history, 8 months ago, In English

problem link: Problem

Submission Link : Submission

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

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You are not handling condition properly ! what if i become i>n and if array size 1 ? check this conditions properly. inside for loop you have to write i<n and check condition if n==1

but yes after fixing this still your code will fail! you are using brute force it will definitely give you tle.