Skip to main content

Questions tagged [algorithm]

A puzzle related to algorithms (a main concept in computer science). Puzzles may ask for an algorithm as an answer or require the analysis of a given algorithm.

Filter by
Sorted by
Tagged with
2 votes
0 answers
94 views

I'm working on a CayleyPy project where we study the diameters of graphs that come from different combinatorial puzzles. At the moment I’m focusing on the Picture-Cube, a 3×3×3 puzzle where each move ...
LillyPilly's user avatar
1 vote
0 answers
179 views

The diamond-shaped Light Out game refers to a Light Out variant with a diamond-shaped grid, characterized by the following structural properties: Total number of rows/columns: $2k+1$ rows (where k is ...
DSTBP's user avatar
  • 183
16 votes
2 answers
795 views

There are 100 full water tanks and 100 empty ones. You are given a hose that can connect any two of them in order to equilibrate the water level between them. All the tanks are cubical in shape, of ...
Tobias Fritz's user avatar
12 votes
1 answer
752 views

A postage stamp collector, once, bought a, supposedly complete, rare set of original postage stamps laid out 5x6. Each item in the set features a unique, rather peculiar, 5x6 pixel artwork. One day ...
FirstName LastName's user avatar
1 vote
3 answers
393 views

This puzzle has a flavor of Hamiltonian puzzles. You are given a set of N rocks placed on a two-dimensional integer grid. The task is to find an orthogonal closed simple path with N orthogonal line ...
Mohammad Al-Turkistany's user avatar
1 vote
2 answers
247 views

How do fix this? All other sides are fixed
N. Pradeep's user avatar
1 vote
1 answer
173 views

I implemented the CFOP method in my Rubik's cube solver. Now I am trying to add the Roux method. I couldn't find the right CMLL algorithm for this particular case. After consulting the CMLL algorithms ...
Arun's user avatar
  • 113
17 votes
4 answers
3k views

Let me start with a formulation of the problem for people who aren't familiar with Magic: the Gathering. You have a stack of distinct cards face-down. You can apply the following actions arbitrarily ...
A. P.'s user avatar
  • 6,160
13 votes
1 answer
1k views

There are four pegs in a row; let's call them A, B, C, and D from left to right. Peg A has a stack of $n$ differently sized disks, sorted in size so the smallest disk is at the top. All other pegs are ...
Bubbler's user avatar
  • 17.8k
-2 votes
1 answer
296 views

The problem to solve: Let's say we have a set of $n$ points on the 2D plane. Determine whether it has axial symmetry. My attempt so far: For n=2 the answer is trivially "yes". For n=3 ...
Nick's user avatar
  • 1,703
7 votes
3 answers
910 views

Fibonacci words are defined as $F_0 = a, F_1 = b, F_{n+2} = F_nF_{n+1}$ where $a, b$ are letters. How can you find the longest Fibonacci sub-word in a given string? Try to solve it in linear time ($O(...
popcorn's user avatar
  • 171
5 votes
1 answer
375 views

Imagine that you are given a box with n nuts and n screws. Each screw have different size (diameter) and on each screw there is ...
popcorn's user avatar
  • 263
2 votes
1 answer
1k views

I have a problem with solving the "Dispersion V2" puzzle on robozzle.com: The puzzle has a robot that can be moved and turned with a program. The goal of the puzzle is to have the robot ...
user avatar
1 vote
1 answer
272 views

[companion question here] I was given an 11x11x11 Rubik's cube as a gift. It came with a guide book that I have been following to solve the cube. I have solved four of the 9x9 sub-centers of the cube,...
Abraham's user avatar
  • 141
17 votes
17 answers
2k views

A group of (possibly over-polite) people have just finished their meal at a restaurant. One of them asks, "Does anyone want dessert?" The table goes quiet. Some of the people might want ...
Mark Green's user avatar
1 vote
1 answer
369 views

I have seen Donald Knuth's Algorithm to guess the correct pattern in maximum 5 tries. However, I want to write a program to find the correct pattern effectively however the code maker can only make a ...
Mounir Zouhari's user avatar
0 votes
1 answer
286 views

Considering a general fake coin problem. There are $n$ coins in total and $k$ of them are fake. Fake coins are lighter than the normal ones. You only have a balance to compare two groups of coins (no ...
picker's user avatar
  • 1
16 votes
1 answer
924 views

On an infinite square grid, some of the squares are occupied by little creatures called blobs. Cute as they are, it is your mission to exterminate all of them! You only have two methods at your ...
Mike Earnest's user avatar
2 votes
1 answer
358 views

This is the story of the sister of the princess in this puzzle. I will shamelessly copy-paste some parts of this post. I have no reference to give for this version as I adapted a Computer Science ...
Nathaniel's user avatar
  • 193
4 votes
1 answer
192 views

This copy machine program prints the solution to a well-known puzzle.  Explanation of the syntax will follow. What solution will be printed for which well-known puzzle?  EXECUTION CODE .--> LoopA-...
humn's user avatar
  • 22.1k
10 votes
2 answers
935 views

You have probably played the classic game of Mastermind with 4 pegs and 6 colours. It turns out that the codebreaker can always find the pattern in 5 moves or fewer. Now consider the 2D version of the ...
Dmitry Kamenetsky's user avatar
5 votes
2 answers
295 views

Suppose I had a little robot on the coordinate grid that moves according to the following rule. If it's at the point $(x,y)$, it can move to either $(x+y,y)$ or $(x,x+y)$. If the robot starts at the ...
sirpuzzle's user avatar
4 votes
0 answers
73 views

Imagine: You have a group of people in a room that is completely dark. Half of the group has red t-shirts and the other half blue t-shirts. The group gets told to think about a strategy to solve the ...
Lazloo Xp's user avatar
  • 141
2 votes
1 answer
340 views

So, I got curious if I could solve from the cube in a cube in a cube in a cube position to the solved state just using its own algorithm. This is the one I was using: B' 2R2 2L2 U2 2R2 2L2 B F2 R U' ...
Caters's user avatar
  • 121
4 votes
1 answer
215 views

A constant is hiding behind this puzzle, can you tell which? 4 $\rightarrow$ 2 $\rightarrow$ 1 $\rightarrow$ 1 $\rightarrow$ 1 $\rightarrow$ $\dots$ ? $\rightarrow$ ? $\rightarrow$ ? $\rightarrow$ $\...
JKHA's user avatar
  • 7,968