lone_rider's blog

By lone_rider, 10 years ago, In English

I'm facing problem with this question. I'm getting TLE on test case 19th. I'm doing this question using Tries. Complexity of my code is O(3 * total length of input) which is no where close to getting TLE. Here is my code : http://ideone.com/uNbDf9. Please help

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

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

Doesnt strcpy() run in O(n) time?

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I have changed my code but i guess the problem would still come as search function takes O(length). Is there any way of solving this question using Tries?