Why is this giving TLE?

Правка en2, от Shinzy, 2024-04-02 10:28:01

Here's The Problem Link:

Problem Link

I analyzed the Time Complexity of my code as O(T*N) and Space Complexity as O(1)

Which should technically satisfy the constrains given, But to my surprise it gives TLE on Test 3:

Here's My Java Submission:

Java Submission

Here's My Python Submission:

Python Submission

Please Help Me Out Guys!, Thanks For Your Valuable Time :)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Shinzy 2024-04-02 10:28:01 118
en1 Английский Shinzy 2024-04-02 10:25:54 465 Initial revision (published)