A java-spring boot application to count number of islands in a 2D array
Steps:
-
Import the project. If you are using IntelliJ IDEA, please choose Maven to import dependencies.
-
Run the application using "Run -> IslandsApplication" or from terminal "mvn spring-boot:run"
-
Open "http://localhost:8080" in your favorite browser
-
Input rows, columns, and in the textarea, input your 2D array separated by "," and "newline" like below:
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
-
Click on Submit and it should show you the number of islands.