Problem 60785. Solve an easy binary puzzle
A binary puzzle presents a square grid (or matrix) of cells in which each cell must be 0 or 1. The finished puzzle must follow these rules:
- It may not have more than two 0s or 1s next to each other in any row or column.
- Each row and column must have an equal number of 0s and 1s.
- No two rows and no two columns can be the same.
Write a function to solve easy binary puzzles—i.e., those that can be solved by applying only the first rule. Empty cells in the initial board will be marked by 9s.
The examples in the test suite and the one below come from binarypuzzle.com.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
4 Solvers
More from this Author291
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!