Islands in a graph using BFS
Given a binary 2D matrix, find the number of islands. A group of connected 1s forms an island. Examples: Input: M[][] = {{‘1’, ‘1’, ‘0’, ‘0’, ‘0’}, {‘0’, ‘1’, ‘0’, ‘0’, ‘1’}, {‘1’, ‘0’, ‘0’, ‘1’, ‘1’}, {‘0’, ‘0’, ‘0’, ‘0’, ‘0’}, {‘1’, ‘0’, ‘1’, ‘1’, ‘0’}}Output: 4Explanation: The image below shows a