Question: You are given a rectangular grid of 0 s and 1 s , where the 0 s represent water and the 1 s represent land.
You are given a rectangular grid of s and s where the s represent water and the s represent land. A landcell
is connected to another if the two are adjacent horizontally vertically and diagonally All the landcells that are
connected in this manner form an island and the number of landcells in the island define the island size. In the
following example, there are a total of islands, their sizes being and
Every island is connected via bridges to the smallest island larger than itself and to the largest island smaller
than itself. In addition, there is a bridge between two islands if their sizes have the same sumofdigits. In the
example, there are bridges between the islands
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
