Getting TLE despite of O(n) time complexity

Правка en1, от msatanzeel, 2021-11-14 21:34:30

Today there was Google's Kickstart round H and I have a doubt in the question 3 of it, here's that link to the problem , I have solved this using a doubly linked list data structure for efficient replacements and anyone can easily analyze that over all time time complexity is O(n) , here's is the link to my code.Can someone please tell the reason for the TLE over large inputs..

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский msatanzeel 2021-11-14 21:34:30 555 Initial revision (published)