Questions tagged [binary-matrix]
Indicates that the challenge involves the manipulation of binary matrices, matrices whose elements are all one of two possible values, typically 1 and 0, or True and False.
73 questions
4 votes
4 answers
640 views
Fill in matrices for matrix bit flipping as quickly as possible
Consider an n by n binary matrix. If it has rank r <= n, then we want to compute the largest number bits flips necessary to reduce its rank to a specific value. All computations should be done ...
14 votes
18 answers
2k views
Stuck on Sokoban
In the classic game of Sokoban the player's character solves puzzles by pushing boxes around a warehouse onto designated targets. Take, for example, this ASCIIfied game level: ...
1 vote
3 answers
342 views
Yin-Yang Table Generator [closed]
I want an n*n table that is filled with black or white and the following conditions are satisfied in it: All cells of a 2*2 square in this table should not be the same color. All black and white ...
12 votes
11 answers
837 views
Find Sub-matrix with matched cell 1
You are given a matrix of size m x n where each cell can contain either 1 or 0. You need to find the largest square submatrix that contains only 1's. The output should be the area of the largest ...
13 votes
8 answers
1k views
Toggle some bits and get an actual square
Inspired by the title of the Toggle some bits and get a square challenge. In that challenge you output how many bits should be toggled, in order for the base-10 representation of the binary to become ...
15 votes
14 answers
2k views
1 to N column and row sums
Inspiration There is a problem on the most recent AMC 12B test, the one held on November 16, 2022, which goes like this: (AMC 12B 2022, Question 17) How many \$4\times4\$ arrays whose entries are \$0\...
23 votes
6 answers
1k views
Tic, Tac, stub your Toe
Find the max number of Xs you can fit onto a rectangular tic-tac-toe board of length l and height h without ever having 3 consecutive Xs in a row diagonally, horizontally, or vertically. This is a ...
19 votes
7 answers
2k views
Matrix Meets ASCII Art
A binary matrix represents a shape in the plane. 1 means a unit square at that position. 0 means nothing. The background is 0. For example, the array ...