Mallepally shashi kanth varma’s Post

Time : O(r*c) Space :O(r*c) where r,c is dimensions of graph approach : performing the dfs and finding the number of islands is trivial , but we need to mark the visited nodes & sort accordingly with the nth island, and construct the out put array

  • text

To view or add a comment, sign in

Explore topics