# Questions tagged [array]

A competition to solve a particular problem through the usage and manipulation of arrays.

777 questions
Filter by
Sorted by
Tagged with
987 views

• 93.8k
455 views

### Sort musical pitches

Given an unordered list of musical pitches, write the shortest program/function (scored in bytes) to sort the list from lowest pitch to highest. Pitches will be given in scientific pitch notation, ...
• 10.9k
2k views

### Repeat List Until Longer

The Challenge The challenge is simple: given an input list a and another list b, repeat a ...
• 5,153
329 views

### The Nineteenth Bakery [duplicate]

Yes, this is very similar to this question. However, that concerns infinite linked lists, and you do not need to handle out of bounds indexes in that question. You are in a strange city, looking for ...
• 5,153
357 views

### What was my Wordle play?

Task Given a winning Wordle play results (clues), the target ("secret") word and a list of words, output a possible sequence of words leading to such results. The words in the list will be ...
• 13.7k
2k views

### Fill in the next numbers

Given a list of integers, output a list where the $i$th element of the list equals the first number in the input list which is $\ge i$, until there are no such numbers. For example, if the ...
• 23.3k
1k views

### Lexicographically Smallest Decreasing Integer Partition

For a given number n, output an strictly decreasing array whose sum is n and its lexicographical order is the smallest for any ...
• 4,937
602 views

### Crate art stacking

Your task is, given a array of numbers, that is strictly increasing, output the crate stack. The input is an array of positive integers which represents which layer has how many crates there are. So ...
• 4,937
2k views

### Is it a tower permutation?

A tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example, here is a tower along with it's height map: <...
• 6,785
1k views

### Wiggle the tower

Your input is the height map of a tower. The tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example <...
• 6,785
1k views

### Pretty print my arrays

I like to pretty print multidimensional arrays, like this: [ [ [1, 2, 3], [4, 5, 6] ], [ [7, 8, 9], [6, 4, 2] ] ] But it's a pain to do by hand and it'd ...
• 34k
960 views

### Smallest maximal rectangle in a skyline

A skyline is an array of positive integers where each integer represents how tall a building is. For example, if we had the array [1,3,4,2,5,3,3] this would be the ...
• 6,785
3k views

### "Defuse" the bombs

You've been hired by a bomb defusing company to perform some "controlled" demolition of un-exploded ordnance. You are given a list of bombs represented by non-negative integers. ...
• 93.8k
907 views

### Simulating Bombs

More advanced version of this The aim of this puzzle is to simulate the impact of the shock wave of bombs on a square grid. The grid initially contains cells labelled ...
• 4,937
319 views

### Heart Point Generator

It's mentioned last time that, in Hearts, Each round every player gets a non-negative amount of points. The sum of the points is 26, and at least one player gets 13 or more points. Actually, it's ...
• 17k
3k views

### Largest rectangle in a skyline

A skyline is an array of positive integers where each integer represents how tall a building is. For example, if we had the array [1,3,4,2,5,3,3] this would be the ...
• 6,785
946 views

### Generate all groupings

Let's define a grouping as a flat list, which is either: just 0 2 groupings followed by the literal integer 2 3 groupings ...
• 23.3k
2k views

### Rolling a ball over a list

Starting with a binary list (just 1s and 0s) we are going to roll a ball over it. The ball has a position and a direction. At ...
• 93.8k
508 views

### Can I wall glitch to there?

Background In a 2d game that I play, each screen is a 2d grid of tiles with walls and walkable tiles, with the player only able to travel on walkable tiles, and being stopped by walls. When the player ...
• 11.2k
215 views

### Cubax Folding Game

Your task is to solve a new puzzle called Cubax. This toy is actually a Chinese puzzle whose expected “final” state is a simple cube. During the festivities, Cubax unfolded, because it cannot move ...
• 4,937
941 views

### Retaining Water

Your task is to check the volume of water in a pool. Your have to create a program that takes in a input that is represented by an 10 by 10 grid of integers, with ...
• 4,937
790 views

### Check if a matrix is Zarankiewicz-maximal

My final-year project at the National University of Singapore is on Zarankiewicz's problem: What is the maximum number of 1s in an $m×n$ binary matrix ($m$ rows and $n$ columns) with no $a×b$ ...
• 2,927
315 views

### Bracket Depth List

Challenge Your challenge is simple, calculate the depth of each matching brackets in the given input e.g. (()()(()))->...
• 4,937
1k views

• 16.8k
2k views

### Remove odd indices and double the even indices

Your task is simple, just remove the odd indices and double the even indices Example the input is Hello, World! and we get indices ...
• 2,861
845 views

### Array depth of a ragged list

This is not a duplicate of this challenge. Here by an array, I mean a nested list that is "not ragged", i.e., it is either a list of elements, or a list of arrays of the same shape. For ...
• 41.9k