ankitstudy88's blog

By ankitstudy88, history, 4 years ago, In English

Can anyone tell why second solution gave TLE

Accepted Solution

87157593

Solution Giving TLE

87147602

  • Vote: I like it
  • +2
  • Vote: I do not like it

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

I also have the same doubt bro,though I am not able to get accepted till now.

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

Bro try passing the string by reference.I also had the same problem.It worked for me.

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Passing the string by value will have an overhead of copying the string every time that function is called and hence it will be slow compared to passing the string by reference.