# 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.

168 questions
Filter by
Sorted by
Tagged with
1k views

### Stacking pancakes for your wife

You are cooking pancakes for your lovely wife. You want to sort the pancakes such that they increase in diameter as you move from the top to the bottom of the stack. The only operation you can perform ...
• 28.9k
1 vote
557 views

### Move all the stones into a single cell of a 3x4 grid

A 3x4 grid contains a heavy stone in each cell. Walking from a cell to an adjacent cell (horizontally or vertically) without any stones requires 1 second. Moving one stone from a cell to an adjacent ...
• 28.9k
2k views

### Emoji primes - what's the smallest positive integer this doesn't work for?

Driven by a silly conversation at work, here's the puzzle. Slack allows users to send emoji as a reaction to a message. Emoji are listed left to right in chronological order of reaction, and 'stacks' ...
• 247
197 views

### Reapply *some* stickers on scrambled cube

I have this weird cube which have some pieces printed on the plastic and some are detachable. The cube was scrambled not solved and it fell on the floor being cheap cube almost all detachable faces ...
250 views

### Looking for an old Rubiks cube algorithm

I learnt rubiks cube before the YouTube days from a blog. I do not find the algorithm anymore online but it is something like White cross White corners (except one) Second layer corners (except one) ...
• 185
326 views

### Brute-force solver for Gear Octahedron - flawed method?

I am working on a program to brute-force a LanLan Gear Octahedron I bought second-hand (and scrambled). I have no background in "cubing" and just fancied solving the problem. The structure comprises ...
• 153
2k views

### Worst way to solve Rubik's in one algorithm

If you apply the same algorithm over and over again the cube will be solved. I want to know what algorithm is the worst one (the one with the longest cycle) I have found RU (cycle of 60 times) I have ...
• 301
325 views

### Heavy-duty computing challenge — maximum-density word packing

Caution: This is a challenge for computers only. Humans are advised to stand well clear of the protective safety cage. There may be CPUs on fire before it's over. Introduction Nothing makes a ...
• 12.7k
2k views

### 2 Person Same Number Verification

Alice and Beth both receive a random integer from 1 through 10, inclusive. They only know the number that they are given. The two of them want to come up with an algorithm to check that their ...
• 598
354 views

• 325
285 views

### Scoring Oracle: Bob easily wins, but how much?

Bob meets a magician with two bags and a chest on a bridge. The magician challenges him with the following enigma: Here is a bag A, holding 5080 pebbles. Here is another bag B. Most of the pebbles ...
• 93
357 views

### Weighing Counterfeit coins

There are $n=4$ coins and we know exactly $2$ of them are counterfeit. In $2$ weighings, how can we find which of the four coins are the counterfeit ones? Assumptions: the counterfeit coins look ...
229 views

### Creating a maze that is traversed by a pair of compasses

Normal mazes require you to move a point-like object from the entrance of the maze to the exit. I am wondering whether a different kind of maze would work as a puzzle: Imagine a maze printed on a ...
• 181
313 views

### Fill $N$ by $M$ grid with numbers in such a way that any given cells' neighbors are different

Create an $N$ by $M$ grid with numbers in such a way that satisfies following conditions: numbers should be integers that range from $1$ to $r$. for any cell $C$, all its adjacent neighbors (i.e. ...
138 views

### Shortest path for delivering packages [duplicate]

A version of the Travelling Salesman Problem, but with certain points. We are talking about a town where 8 canals run from the middle boathouse into the city. You can only travel one way on the green ...
• 51
728 views

### Puzzles like Sokoban?

I am looking for some puzzles like Sokoban or 15-puzzle but more difficult to solve and satisfy the following requirements: The number of possible moves at each step should be limited, let's say < ...
• 103
945 views

### What is the next method after 3-style in 3x3 Blindfolded? [closed]

I have been using the method 3-style for over 2 years, 3-style and I have settled in the range of 25-30 seconds. I wish to permanently become sub-20, and for that I am planning to undertake the uphill ...
• 175
426 views

### 20-Questions on a grid

Posted this on /r/puzzles too, none have given the right strategy as of now :) There is a square grid of width and height $m$. Three facts about the grid: Each cell has a value, and no two cells ...
182 views

### It's getting harder and harder for my friends to like me

What is the next number in this sequence? 2, 3, 6, 7, 9, 18, 25, 27, 54, 73, 97, 129, 171, 231, 313, 327, 649, 703, ... ? Hint 1 Hint 2 This is my first puzzle and I'm new to PSE, so feedback is ...
• 2,027
370 views

### How to discover twisty puzzle algorithms that are not commutators?

I am reasonably competent at using commutators to find my own algorithms on twisty puzzles. Many good tutorials for this exist online. However, there are also algorithms that are not commutators, ...
• 927
539 views

### Ten users, three lights but it's a chatroom

This is a variant of the classic problem of m prisoners n lights. (Example may be found here but note that the requirements are not exactly the same) The goal for you, however, is different. You want ...
• 168
163 views

### Ten users, ten deadly collars and three lights [duplicate]

One day, 10 puzzling.SE users, including you, find yourselves in a horrible prison. Each of you has a deadly collar, presently lethal. It is safe to take off only when all of the 10 collars have been ...
• 168
215 views

### A couples therapy mixer situation

During couples-group-therapy, where two therapist and multiple couples consisting of two people each are present and we all sit on chairs forming a circle in the middle of the room. We often discuss ...
• 546
103 views

### How can these people cross the bridge? [duplicate]

There are 4 people that must cross an old dilapidated bridge at night, All four walk at different speeds: There is a young teenager that can cross the bridge in 1 minute. There is teenager's older ...
• 31
7k views

You are a spy trying to break into an enemy facility. The back door is protected by an electronic keypad lock. You know that this particular lock is opened by a four digit code. Any stream of button ...
• 31.7k
354 views

### Scheduling Meetings

I came across this problem in real life and thought it could be made into an interesting puzzle. I will enjoy seeing how my eventual solution could be improved! Here's the situation. There ...
• 22.4k
1 vote
2k views

### Is my 5x5 cube in an "illegal" position?

I've never seen this position before. I'm starting to think it's an "illegal" one because I lent it to a friend and he said he had to glue some fallen stickers. Am I missing an algorithm or ...
$RUR'U RU2R'$ I use this algorithm to: permute UL and UF edges (messing up corners) orient LL from a fish (possibly using its mirror) orient pairs of LL corners by combining above algorithm with its ...