Top "Puzzle" questions

DO NOT USE - prefer constructive questions, or use more descriptive tags.

Generalised Two-Egg Puzzle

Here is the Problem Description : Suppose that we wish to know which stories in a N-story building are safe to …

algorithm puzzle dynamic-programming
How do you answer questions in interviews for which you think, they are senseless?

I am mentioning a few questions which are usually the part of interviews, I dont understand what is the intent …

puzzle
Place random non-overlapping rectangles on a panel

I've a panel of size X by Y. I want to place up to N rectangles, sized randomly, upon this …

algorithm random 2d puzzle
How to print all possible balanced parentheses for an expression?

For example, with elements a,b,c,d, there are 5 possible ways to take neighboring elements and reduce them into …

algorithm puzzle catalan
Algorithm: Max Counters

I have the following problem: You are given N counters, initially set to 0, and you have two possible operations on …

c# algorithm puzzle
The "guess the number" game for arbitrary rational numbers?

I once got the following as an interview question: I'm thinking of a positive integer n. Come up with an …

algorithm math puzzle rational-numbers
Anagram algorithm with minimum complexity

I recently was asked to design an algorithm that checks if two strings are anagrams of one another. My goal …

c algorithm complexity-theory puzzle anagram
Generalizing the algorithm for domino tiling?

In this earlier question the OP asked the following problem: Given a rectangular grid where some squares are empty and …

algorithm puzzle tiling
What is an elegant way to check if 3 variables are equal when any of them can be a wildcard?

Say I have 3 char variables, a, b and c. Each one can be '0', which is a special case …

c# puzzle equality
Solve 8-puzzle game

I'm trying to code a 8-puzzle game solver in C++, but I'm having a lot of problems while doing it. …

c++ algorithm distance puzzle sliding-tile-puzzle