Solve an easy binary puzzle - MATLAB Cody - MATLAB Central

Problem 60785. Solve an easy binary puzzle

Difficulty:Rate
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:
  1. It may not have more than two 0s or 1s next to each other in any row or column.
  2. Each row and column must have an equal number of 0s and 1s.
  3. 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

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jan 23, 2025

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
18
8

Problem Recent Solvers4

Suggested Problems

More from this Author291

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page