Problem 56473. IQpuzzler Preparation #2: Detect isolated zeros in a 2D matrix
Return true if any isolated single zeros are present in the input M-by-N matrix (zeros with all adjacent elements being non-zero).
Example:
[ 2 2 0
2 0 5 ==> true
5 5 5 ]
[ 2 2 3
0 0 5 ==> false
5 5 5 ]
Background:
This function can be useful in different board games, such as Go, or the upcoming IQpuzzler challenge.
Solution Stats
Problem Comments
-
2 Comments
DJ
on 7 Nov 2022
Since when does diagonally adjacent element are not counted as adjacent?
Or maybe you should clarify what you mean by adjacent.
Stefan Abendroth
on 7 Nov 2022
The first example in the problem description was chosen just for this reason.
Solution Comments
Show commentsProblem Recent Solvers9
Suggested Problems
-
Project Euler: Problem 3, Largest prime factor
1785 Solvers
-
Construct a string from letters and counts
146 Solvers
-
First non-zero element in each column
939 Solvers
-
392 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
252 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!