osource's blog

By osource, history, 4 years ago, In English

Hello,

I was solving CSES problemset and am stuck in this question — Question My code — Code

I am getting TLE on 4 test cases. I'm not able to figure out why as I have used standard BFS and therefore the time complexity should be O(m*n). Can someone help me in this?

  • Vote: I like it
  • -17
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Its because of maps. You can use 2D array instead.