Open In App
Related Articles

Puzzle 42 | (Placing the numbers)

Improve Article
Improve
Save Article
Save
Like Article
Like
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.
Geeks

 

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:
Geeks1
?
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:
geeks2

If you like GeeksQuiz and would like to contribute, you can also write an article and mail your article to review-team@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.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 19 Jan, 2023
Like Article
Save Article
Previous
Next
Similar Reads