Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 100664

This tag is for challenges involving matrices. A matrix, also known as a 2D array, is a list of numbers arranged in a rectangle with rows and columns.

22 votes
2 answers
1k views

Minecraft piston pushing

Your challenge Take as input a 5x5 matrix or similar, containing one piston at the bottom, and output the result of the single piston pushing upwards, as 5x6. …
emanresu A's user avatar
  • 44.2k
18 votes
8 answers
1k views

Drop some boxes

Input can be as a matrix, text, whatever. The input will always be a solid block - nothing like BB AAA Will ever be inputted, so you don't have to parse spaces / empty values. …
emanresu A's user avatar
  • 44.2k
16 votes
10 answers
824 views

Remove submatrices

Given two integer matrices a and b, your challenge is to replace any occurences of b in a with a matrix of the same size filled with 0s. …
emanresu A's user avatar
  • 44.2k
16 votes
11 answers
2k views

Flood fill by distance

containing obstacles, flood fill it like so from the top left hand corner and output a corresponding matrix. … You may take any two consistent values in the matrix instead of 1 and 0, and you may choose any value to represent obstacles. Distances may be 0 or 1-indexed. …
emanresu A's user avatar
  • 44.2k
16 votes
17 answers
840 views

Square chunk my matrix

Your challenge is to write a function/program that takes a matrix of integers m and a number n as input and: Splits m into n by n chunks Replaces each chunk with the most common value in that chunk ( … Outputs the resulting matrix. Note: You can take either the size of a single chunk, or the number of chunks to a side. …
emanresu A's user avatar
  • 44.2k