1 machine-learning interview question on DFS.
Problem: Count Lakes Wrapped by a Given Island You are given a binary matrix of size m × n : - Cells with value 1…