Блог пользователя Shuaib

Автор Shuaib, 11 лет назад, По-английски

Can someone please help me understand how to approach this problem?

I tried coding a dfs for cycle detection, but I think a cycle in the maze in this problem isn't the same as a cycle in a graph?

Any thoughts very appreciated.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
11 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Never mind, I solved it. Need to convert the maze into proper grid representation, and do a flood fill to count cycles.