# Puzzle 42 | (Placing the numbers)

Place the numbers

**1, 2, 3, 4, 5, 6, 7, 8**into the eight circles in figure given below, in such a way that no number is adjacent to a number that is next to it in the sequence.For example**1**should not be adjacent to 2 but can be adjacent to**3, 4, 5, 6, 7, 8**. Similarly for others.

**We strongly recommend you to minimize your browser and try this yourself first**

**Trivial Solution:**

Trying for

**8!=40320**combination would be tedious task.

**Smart Solution:**

- The easiest numbers to place are 1 and 8, because each has only one number to which it cannot be adjacent, namely, 2 and 7, respectively.
- The hardest circles to fill are those in the middle, as each is adjacent to six others.

This suggests that we place 1 and 8 in the middle circles. If we place 1 to the left of 8, then the only possible positions for 2 and 7 are shown figure below:

The number 3 must now be placed on the left-hand side of the diagram, and 6 must be placed on the right-hand side.

Now it is easy to place all the remaining number as shown in figure below:

This article is contributed by Vikash Kumar. If you like GeeksQuiz and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

## Recommended Posts:

- Puzzle 1 | (How to Measure 45 minutes using two identical wires?)
- Puzzle 2 | (Find ages of daughters)
- Puzzle 3 | (Calculate total distance travelled by bee)
- Puzzle 4 | (Pay an employee using a 7 units gold rod?)
- Puzzle 13 | (100 Prisoners with Red/Black Hats)
- Puzzle 5 | (Finding the poisoned wine)
- Puzzle 6 | (Monty Hall problem)
- Puzzle 7 | (3 Bulbs and 3 Switches)
- Puzzle 8 | (Find the Jar with contaminated pills)
- Puzzle 9 | (Find the fastest 3 horses)
- Puzzle 10 | (A Man with Medical Condition and 2 Pills)
- Puzzle 11 | (1000 Coins and 10 Bags)
- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle 14 | (Strategy for a 2 Player Coin Game)
- Puzzle 15 | (Camel and Banana Puzzle)