CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 20:24:03 GMT
content-type: text/html; charset=utf-8
cf-ray: 965edbac5b05ea32-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=3145cae6-50a4-4f79-a6e6-a13603ea7372; expires=Mon, 27 Jul 2026 20:24:03 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: 8d6ad280-4670-49f7-a33c-3a110c411bdf
x-worker-origin-response-time: 493000000
x-dns-prefetch-control: off
set-cookie: prov=3145cae6-50a4-4f79-a6e6-a13603ea7372; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=HKIYwlBucjCmBsZ79pAhm5ibGyVu3QyqtfqNyOmv074-1753647843-1.0.1.1-b.x8AOr9Bhoj0vMiRBwFuayku6Riczs..WdRCV.ML.t6LFhBq7J2cBbq88LdX55GaPQcoXpwRm9JqKBPUBV04s6k_cN2E5L3fJ1RIoXwHSs; path=/; expires=Sun, 27-Jul-25 20:54:03 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=5rMz_rtbrQsHEhrIjuZGQsmsKFHFxPgKvCxyEfKzWcI-1753647843763-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
- Interface boundary condition and displacement current between two media
- Is there such a thing as 'aerospace grade software'?
- Are you required to protect trade secrets revealed to you even if you didn't sign an NDA?
- rock paper scissors game with randomized system choices. NOT using rnd()
- Not being introduced to the team – should I ask for it?
- Civilian airplanes with inside fuselage jet engines
- What does "enter the hold at arden" mean
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- How to avoid aligning the top of nested braces in cases environment?
- Shared-Memory Queue Implementation in C
- Forces applied to a car hood while driving
- "I met a monk and philosopher." How many people did I meet?
- Calculus Books Recommendation
- Film or TV series about powerful man who is banished, fishes beings he creates from ponds
- Algebraic independence of even polynomials
- Blinded despite Blindsight?
- How to extend an MDF shelf?
- When was the last time all humans were on the ground not in the air?
- Dynamics from iterated averaging
- Sci-fi book where aliens make contact, ask humans to transport themselves to nearby portal
- A word with five hundred of a single alphabet? That must be a myth.
- What's the difference between an eVisa and ETA travel authorization?
- Does SZNUD3160 really eliminate the need for diode?
- Story that taught cryptography in the form of a manga