CSES Labryinth TLE?

Revision en1, by Forrest_Gump, 2020-11-26 17:21:05

I have commented the code at places. I can't understand why the code gives TLE. I have tried to optimise it as much as I could but still TLE. Help would be appreciated. I have used breadth first search to solve the problem.The problem

Also what would be worst case complexity?

Code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Forrest_Gump 2020-11-26 17:22:04 23 Tiny change: 'ives TLE. I have tri' -> 'ives TLE. 1 test case gives TLE.I have tri'
en1 English Forrest_Gump 2020-11-26 17:21:05 2133 Initial revision (published)