My favourite programming problems
Here are the programming problems I found very enjoyable to solve:
N queen problem
The wolf has started his way
Find all placements of N queens on the NxN sized chessboard so that no two queens threaten each other.
Find solution for as big N as you can.
7
The wolf is patiently walking
You are given the false expression:
1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 = 7
You can use any number of parentheses to make this expression true.
Find all solutions containing no useless parentheses.
Tic-tac-toe
The wolf is walking little faster
You are given some state of the Tic-tac-toe game. You have to answer the question: who will win if both players play ideally?
35
You are given the expression:
The wolf is gaining speed
((((1?2)?3)?4)?5)?6 = 35
You can replace any ?
with the one of the next operations +, -, *, /
.
Find all configurations where the expression is true.