mohit_joshi's blog

By mohit_joshi, history, 3 years ago, In English

Problem link I have applied the same approach as mentioned in the editorial , but I am still getting TLE.I need some hints about where I am doing wrong. Mycodelink Thanks for the help in advance.

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

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

Constant factors matter. While your solution technically has the correct time complexity, there's no need to use maps in your data struct, you could use arrays of size 3 instead, which speeds up your solution considerably.