All Questions
Tagged with code-golf decision-problem
737
questions
3
votes
18
answers
305
views
Check if two lists are permutations of each other [duplicate]
Challenge
Given two lists of equal length, find if one of them is a permutation of the other. Output truthy or falsy values, or 1 or 0.
Test case Examples
...
18
votes
19
answers
4k
views
Wait, ASCII was 128 characters all along?
Challenge
In this challenge, you have to take a nonnegative integer as input, convert it into base-128 bytes (0 → 0x00, 127 → ...
20
votes
15
answers
2k
views
Sorting with a deque
You're given an array of positive integers. Your job is to sort them using an initially empty deque (double-ended queue) by the following procedure:
Take a number from the front of the array, and ...
9
votes
13
answers
1k
views
Is it an option for the ls utility specified in POSIX.1-2017?
The ls utility lists specified directory content. It is infamous for stupidly lots of options which is known for anti-pattern design of implementing software.(...
11
votes
15
answers
2k
views
Is this a Hadamard matrix?
Hadamard matrices is a square matrix whose entries are either +1 or −1 and whose rows are mutually orthogonal.
In other words, it means that each pair of rows has matching entries in exactly half of ...
3
votes
1
answer
125
views
Detect revokes in Jass
Jass is a trick-taking game for four players and the national card game of Switzerland. It is played with a 36-card deck, four suits each with ranks 6, 7, 8, 9, 10, J, Q, K, A. We will be using French ...
20
votes
23
answers
1k
views
Is this a valid PZN?
Is this a valid PZN?
A Pharmazentralnummer, or PZN, is an eight-digit code which uniquely identifies medications, medical products, and similar items in the German healthcare system. Examples include ...
15
votes
5
answers
1k
views
Is this a solvable Numberlink?
Challenge
Per Wikipedia:
Numberlink is a type of logic puzzle involving finding paths to
connect numbers in a grid.
The player has to pair up all the matching numbers on the grid with
single ...
26
votes
14
answers
2k
views
Is it a cartesian product?
The cartesian product of two multisets \$A\$ and \$B\$ is the multiset of all ordered pairs consisting of an element of \$A\$ and an element of \$B\$. For example, the cartesian product of \$\{1, 2, 7,...
29
votes
5
answers
2k
views
Can I Clear The Grid?
I recently found this game and have been enjoying it. Basically, there is a grid of colored tiles and you act by clicking on empty spaces. When you click an empty space, the first tile (if any) in ...
10
votes
5
answers
975
views
Manipulate integers to zero
Objective
Given a nonempty unordered list of positive integers, decide whether they can be added, negated, or multiplied to yield a single zero. Each given number must be used exactly once.
There is a ...
21
votes
15
answers
2k
views
Can I follow this recipe?
You work in a kitchen which has a peculiar rule. When you mix something into a pot you must always add at least one new ingredient.
So you can add pasta, oil, salt then pesto, but not pasta, pesto, ...
18
votes
26
answers
2k
views
Is it a tetrate of two?
The tetration operation consists of repeated exponentiation, and it is written ↑↑. For instance,
3↑↑3 =3 ^(3^3) = 3^27 = 7,625,597,484,987
A tetrate of two is an ...
10
votes
5
answers
555
views
Is the king in check?
Challenge:
Given a 2D array (8x8) of characters, is the enemy king in check?
The program should return true if and only if the king is currently in check.
Standard chess rules apply.
Specifications:
...
18
votes
12
answers
2k
views
Is it a valid ARM immediate value?
Exposition
In this challenge, I am talking about ARM assembly language. ARM is a 32-bit RISC processor; I'll use instruction set up to architecture v6.
To load a constant ("immediate") value ...