Chessboard and Dominos Puzzle-Asked in Interviews.

Question:

There is an 8 by 8 chessboard in which two diagonally opposite corners have been cut off. You are given 31 dominos, and a single domino can cover exactly two squares. Can you use the 31 dominos to cover the entire board?

Solution: No

Explanation:
At first, it seems that there were 8*8 = 64 squares
then 2 have been cut off so Squares remaining= 64–2 = 62
And there are 31 dominos, so they will cover the remaining chessboard coz = 31*2 = 62

But this is not the answer:

Let's visualize it:

Each domino we set on the chessboard will always take 1 Black and 1 White square. Therefore, 31 dominos will take 31 white squares and 31 black squares exactly. On this chessboard, however, we must have 32 black and 30 white squares. Hence it is not possible to do so.

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--

--

Upskilling students for tech placements!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Basic Authentication In Your Phoenix App

Portainer client in python

The 5-Dimensions of Human-Centered Healthcare Platforms (HCHP): The Structure of Future Healthcare…

Interview with Enrico Graziani

[Leetcode 704]Binary Search

Building my first JSON API with Rails

Serverless: Filtering Amazon Kinesis Event Streams with AWS Lambda

Getting Started with Cloud Shell and gcloud (Google Cloud)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Placewit

Placewit

Upskilling students for tech placements!

More from Medium

Leetcode Q561. Array Partition I (Q469)

Leetcode 462. Minimum Moves to Equal Array Elements II

937. Reorder Data in Log Files

Meta / Amazon / Google / Microsoft| Trim a Binary Search Tree | LeetCode-669: Medium | JavaScript…