Driver Code
public static void Main ( String [ ] args ) { int [ , ] a = new int [ , ] { { 1 , 1 , 0 , 0 , 0 } , { 0 , 1 , 0 , 0 , 1 } , { 1 , 0 , 0 , 1 , 1 } , { 0 , 0 , 0 , 0 , 0 } , { 1 , 0 , 1 , 0 , 1 } } ; Console . WriteLine ( " Number ▁ of ▁ Islands ▁ is : ▁ " + countIslands ( a ) ) ; }