Shuaib's blog

By Shuaib, 12 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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