This month’s contest was very tough for me. But I learned a lot :). I solved the 2 easiest problems and Minesweeper . But the worst part was finding the logic behind the Fire Escape Routes problem. And not being able to implement it correctly. I started by using ArrayList of HashSets which was not the efficient method.
My ArrayList< HashSet< Integer>> solution. I kept getting TLE .
Then I learned about the Disjoint Set Forest data structure. It was easy enough to implement. But I still don’t know where I’m going wrong.
I used Java. Please help me. Thank you