Top "Puzzle" questions

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

Calculating Manhattan Distance in Python in an 8-Puzzle game

I am trying to code a simple A* solver in Python for a simple 8-Puzzle game. I have represented the …

python search puzzle a-star
C# Potential Interview Question…Too hard?

Without running this code, identify which Foo method will be called: class A { public void Foo( int n ) { Console.WriteLine( "…

c# .net puzzle
Solving Nonograms (Picross)

it's Friday afternoon, let's have a fun puzzle/algorithm problem to solve. One of my favorite Nintendo DS games is …

algorithm puzzle
review of a codility test - pair_sum_even_count

I recently took an online test on codility as part of a recruitment process. I was given two simple problems …

java algorithm puzzle
What can be the efficient approach to solve the 8 puzzle problem?

The 8-puzzle is a square board with 9 positions, filled by 8 numbered tiles and one gap. At any point, a tile …

algorithm logic puzzle a-star sliding-tile-puzzle
Fastest algorithm for circle shift N sized array for M position

What is the fastest algorithm for circle shifting array for M positions? For example, [3 4 5 2 3 1 4] shift M = 2 positions should be [1 4 3 4 5 2 3]. Thanks …

algorithm arrays math puzzle programming-pearls
Efficiently reverse the order of the words (not characters) in an array of characters

Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of …

algorithm language-agnostic reverse puzzle
Bridge crossing puzzle

Four men have to cross a bridge at night.Any party who crosses, either one or two men, must carry …

algorithm puzzle
How to find the Largest Difference in an Array

Suppose I have an array of integers: int[] A = { 10, 3, 6, 8, 9, 4, 3 }; My goal is to find the largest difference between A[Q] …

c# algorithm puzzle