All Questions
Tagged with array code-challenge
16 questions
23
votes
6
answers
5k
views
Play the Fruit Box Game
Play the Fruit Box Game
Intro
Fruit Box is a game consisting of a 10x17 grid of numbers, each between 1 and 9, where the goal is to clear as many numbers as possible in a two-minute time window. In ...
2
votes
0
answers
235
views
How long to paint this house? [closed]
Here is the problem, for which I can only think of an iterative solution and have not found a closed formula:
You need to paint a house with R rooms.
For each room there are four walls and one ...
2
votes
0
answers
143
views
Dobble Double Challenge [closed]
I have a problem, which I haven't found a solution for. Solutions to the first part are well documented, but I have yet to find anyone who has solved the second part. I call this the "Dobble"...
3
votes
3
answers
177
views
Golf range minimum queries of a list [closed]
(Inspired by the first problem solved in Stanford’s advanced data structures course.)
Despite the academicese-heavy name, the problem we're going to solve is almost unbearably simple.
We have a list ...
11
votes
4
answers
469
views
Sort a list, poorly
Don't you hate it when you're trying to roughly sort a list based on user data, but you have to poll the user for thousands of comparisons?
Hate no more, because the answers to this challenge are (...
18
votes
2
answers
10k
views
Rubik-sorting a matrix (a.k.a. the torus puzzle)
The idea for this code-challenge is simple: given a matrix of integers, let's sort it by applying Rubik-style movements. This means that you can select a single row or column and rotate its elements ...
37
votes
28
answers
4k
views
Is the matrix centrosymmetric... and so is the code?
Defintion
A centrosymmetric matrix is a square matrix that is symmetric about its center. More rigorously, a matrix \$A\$ of size \$n \times n\$ is centrosymmetric if, for any \$i,\: j \in ([1, n] \...
19
votes
1
answer
738
views
Advent Challenge 1: Help Santa unlock his present vault!
Next >>
Descriptive Keywords (for searching): Make Two Matrices Equivalent, Overlap, Array, Find
Challenge
Santa has had a history of elves stealing presents from his vault in the past, so this ...
4
votes
0
answers
508
views
Minecraft Pumpkin / Melon overload [closed]
DONT EVALUATE YET, ALMOST FINISHED, NEED A CLEAR WINNING CRITERION
Make me rich in minecraft
Minecraft is a 3D game made of blocks that you can destroy and place. There are some interesting farms ...
11
votes
1
answer
297
views
Split arrays and programs in half
Introduction
You have been tasked to write a program that splits a rectangular integer array evenly in half (for whatever reason).
This task is computationally intensive, but luckily you have a dual-...
9
votes
1
answer
370
views
Sort scrambled two-dimensional array filled with numbers by swapping adjacent numbers [closed]
A two-dimensional array of size n×n is filled with n*n numbers, starting from number 1. Those numbers are to be sorted per row in ascending order; the first number of a row must be greater than the ...
48
votes
25
answers
6k
views
First code golf decathlon [closed]
Tasks
All competitors try to solve the following list of 10 tasks:
math
Read a positive integer n from input and return the sum of the cubes of the first n non-negative integers.
For input ...
2
votes
4
answers
5k
views
Rotate 2D Array [duplicate]
Given an input of a 2 dimensional array of integers, rotate the array 90 degrees clockwise.
It should work for rectangular arrays of all sizes and proportions.
The rotated array should be printed at ...
4
votes
2
answers
812
views
Deplane! Deplane! (Or: RGBRGBRGB => RRRGGGBBB?)
Imagine bytes in memory for an RGB image--R and G and B represented by bytes in sequence. If an image is NxM then the memory layout will be M repetitions for vertical scanlines of 3*N bytes in ...
5
votes
15
answers
664
views
Create a hash from an array of arrays of key|value pairs [closed]
Starting from an array of sub-arrays, each sub-array is a 2 elements key|value pair. Example
input = [["A", 5], ["B", 2], ["A", 12], ["B", -2], ["C", 7]]
Convert ...