CARVIEW |
Select Language
HTTP/2 200
date: Mon, 28 Jul 2025 00:18:25 GMT
content-type: text/html; charset=utf-8
cf-ray: 966032f76f275917-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=b5d53f5a-2a49-438a-a2a9-5a270f36ebe3; expires=Tue, 28 Jul 2026 00:18:24 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 91645807-ddae-4b61-b395-69c5356a15bc
x-worker-origin-response-time: 533000000
x-dns-prefetch-control: off
set-cookie: prov=b5d53f5a-2a49-438a-a2a9-5a270f36ebe3; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=EifnDWXsHc8_9BUkLqFVjsCAcEVreO3QrdtkagZDmA8-1753661905-1.0.1.1-vzv3kI4vZ3PpBULeJowej3Cnr3bjXi_Z9P5twUs4JFrOyrCX.j5LRaKtDjtzf_yBb2zKNX623Yv8yu.J3ALr0aXVvCkMVO4QWvbdTnvWU.g; path=/; expires=Mon, 28-Jul-25 00:48:25 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=wqORiahFEL58HWEmS6ya5Bgu_3Qq4bjuPp_Xd6xFbx8-1753661905095-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'array' Questions - Code Golf Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [array]
A competition to solve a particular problem through the usage and manipulation of arrays.
833 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
18
votes
5
answers
1k
views
Hide from the "left-hand wall" robot
You need to hide in a maze from a robot which methodically follows the left hand wall rule. That is, it enters, immediately turns left, and will always move keeping its left hand on the wall. It only ...
14
votes
11
answers
628
views
Slender sub-lists
A somewhat interesting task came up for me recently which I thought would make a fun code-golf.
Given a number \$n\$ and a list of positive integers less than or equal to \$n\$, we call a sublist ...
5
votes
5
answers
290
views
Calculate the Squadrat "yard"
Write a program/function to calculate the squadrat "yard" from a collection of squadrats.
Squadrats is a platform that gamifies outdoor activities by recording which large (~1.6 km square) ...
7
votes
9
answers
498
views
The Array Walker (part 2)
The Array Walker (part 2)
Input: A non-empty array of integers (without nesting1). This can have negative values!
Output: A boolean value2 indicating whether we can reach the end of the array when ...
9
votes
4
answers
510
views
Triangular Transposition Cipher
A text that can be arranged triangularly in some fashion can be read back in some other fashion effectively enciphering it.
Narrowing down a set of plausible triangular numberings allows to ...
7
votes
22
answers
795
views
Can we escape from array?
Can we escape from the array?
Input: A non-empty array of non-negative integers (without nesting1).
Output: A boolean value2 indicating whether we can reach the end of the array when starting from the ...
13
votes
7
answers
862
views
Traverse the list
Update 2025-06-04: Thanks for the submissions everyone! It seems like a lot of the solutions are quite slow / timeout for the 100 length test case, so I don't think any will be able to do the 10k. ...
9
votes
16
answers
753
views
Maximum contiguous subarray average
Take an array of integers and an integer K. For all contiguous subarrays of length at least K, return the maximum average value (sum of all elements in the subarray divided by length of subarray, ...
10
votes
6
answers
766
views
Optimal Assembly Jump Distance
In some forms of assembly, there are separate "short jump" and "long jump" instructions. However, these jumps can themselves have different lengths, which can affect the distance ...
7
votes
8
answers
868
views
Implement PHMINPOSUW (Packed Horizontal Word Minimum)
PHMINPOSUW (Packed Horizontal Word Minimum) is a specialized x86 instruction that finds the minimum value and location of a 16-bit unsigned integer in an 8-element vector packed into a 128-bit ...
4
votes
1
answer
272
views
Find the factor to use for shortest simple Brainfuck data initialization loop
I like writing answers using Brainfuck, since this language basically simulates a Turing machine, and it is pretty challenging to find the shortest answer for any problem, since there are a lot of ...
11
votes
9
answers
951
views
All possible swaps for the permutation
Given a permutation of {1,2,...,n} named A, do each swap of form swap A[i], A[j] exactly once, where ...
12
votes
8
answers
777
views
Output the symmetric inverse semigroup
The symmetric inverse semigroup is a very important object in the study of semigroups, for a number of reasons, but most obviously due to the Wagner-Preston theorem. In brief, for any set \$X\$, the ...
7
votes
4
answers
1k
views
Tips for golfing in array languages
We already have a few language-specific tips threads for languages which fall under the array-language umbrella, but there are many golfing tricks which are more or less universal among these ...
15
votes
14
answers
2k
views
Max Island Area
You are given a two-dimensional array consisting of 0s and 1s. The number of rows and columns can vary. For example, 10 by 20.
0 represents water.
1 represents land.
Your task is to find the area of ...
Welcome to Code Golf and Coding Challenges Stack Exchange! This is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
code-golf × 799
number × 89
math × 77
matrix × 71
decision-problem × 70
sorting × 55
string × 54
integer × 47
arithmetic × 40
sequence × 25
permutations × 21
ragged-list × 20
grid × 19
subsequence × 17
code-challenge × 16
random × 16
combinatorics × 14
optimization × 12
geometry × 11
binary-matrix × 11
counting × 11
game × 10
data-structures × 9
tips × 9
graph-theory × 8
more related tags
Hot Network Questions
- Source for Adam naming the angels
- I don't have enough alive employees to start the day. What now?
- Hypothetical copyleft exposure developer on proprietary project, legal?
- What is the difference between the Senatorum Imperialis and the Adeptus Terra?
- Dynamics from iterated averaging
- Balancing a Holy Water Bomb
- When was thermal expansion in solids first described?
- How to deter wasps from an untreated larch fence
- Why does Timor-Leste call itself a "Democratic Republic" despite little apparent Marxist-Leninist ideology?
- Why is Donald Trump portrayed like a Canadian in South Park S27E01?
- How to change opamp variable resistor to fixed resistor?
- Are classified documents subject to a subpoena in discovery?
- How to make that the object sliding down along the local axis while following the rotation of the another object?
- Mac Pro 2008 almost dead
- “Unclear step in a math book for entertainment”
- Partitioning heaps - Why?
- Calculus Books Recommendation
- Self explanatory
- How can my dwarves keep humans from reverse engineering their technology?
- Kepler's first law proof error - can anyone help me see what the error is?
- Why doesn't the Windows C compiler reuse incoming shadow space in noreturn functions?
- How does one justify the rationality of buying insurance?
- What is the parity of a neutrino?
- Shared-Memory Queue Implementation in C