Continue reading "Gold box problem"

The post Gold box problem appeared first on Puzzle Book.

]]>2 players play a game, where the motive is to collect the maximum number of gold coins. Each player can see how many coins are present in each box, but can get a box from either end only, on his turn.

Design a strategy such that Player1 wins (Assuming both players play smartly)

Source: Amazon Interview

Find Solution here

The post Gold box problem appeared first on Puzzle Book.

]]>The post Remainder Problem appeared first on Puzzle Book.

]]>Source: www.time4education.com

Find Solution here

The post Remainder Problem appeared first on Puzzle Book.

]]>Continue reading "Duck and Fox"

The post Duck and Fox appeared first on Puzzle Book.

]]>Source: Raphael Reischuk Riddles

Find Answer here

The post Duck and Fox appeared first on Puzzle Book.

]]>Continue reading "Hats on a Death Row"

The post Hats on a Death Row appeared first on Puzzle Book.

]]>“I’m gonna give you prisoners a chance to go free tomorrow. You will all stand in a row (queue) before the executioner and we will put a hat on your head, either a red or a black one. Of course you will not be able to see the color of your own hat; you will only be able to see the prisoners in front of you with their hats on; you will not be allowed to look back or communicate together in any way (talking, touching…..).

The prisoner in the back will be able to see the 19 prisoners in front of him. The one in front of him will be able to see 18…

Starting with the last person in the row, the one who can see everybody in front of him, he will be asked a simple question: WHAT IS THE COLOR OF YOUR HAT?

He will be only allowed to answer “BLACK” or “RED”. If he says anything else you will ALL be executed immediately.

If he guesses the right color of the hat on his head he is set free, otherwise he is put to death. And we move on to the one in front of him and ask him the same question and so on…

Well, good luck tomorrow, HA HA HA HA HA HA!”

Now since you all can communicate freely during the night, can you find a way to guarantee the freedom of some prisoners tomorrow? How many?

Source: www.brainden.com

Find Answer here

The post Hats on a Death Row appeared first on Puzzle Book.

]]>Continue reading "2 Goats and 1 Car"

The post 2 Goats and 1 Car appeared first on Puzzle Book.

]]>Hint: It is not 1/2 as you would first think.

Find Answer here

The post 2 Goats and 1 Car appeared first on Puzzle Book.

]]>Continue reading "Find the Number"

The post Find the Number appeared first on Puzzle Book.

]]>When I divide it by 2, the remainder is 1.

When I divide it by 3, the remainder is 2.

When I divide it by 4, the remainder is 3.

When I divide it by 5, the remainder is 4.

When I divide it by 6, the remainder is 5.

When I divide it by 7, the remainder is 6.

When I divide it by 8, the remainder is 7.

When I divide it by 9, the remainder is 8.

When I divide it by 10, the remainder is 9.

Got the answer??

Find Answer here

The post Find the Number appeared first on Puzzle Book.

]]>Continue reading "The Dream Job"

The post The Dream Job appeared first on Puzzle Book.

]]>Source: www.testfunda.com

Find Answer here

The post The Dream Job appeared first on Puzzle Book.

]]>The post One Cord appeared first on Puzzle Book.

]]>How should you light the cord in order to determine a time interval of 15 minutes?

(Hint: solve the Two Cord puzzle first.)

Source: Raphael Reischuk

Find Answer here

The post One Cord appeared first on Puzzle Book.

]]>The post Two Cords appeared first on Puzzle Book.

]]>How should you light the cords in order to determine a time interval of exactly 15 minutes?

Source: Raphael Reischuk

Find Answer here

The post Two Cords appeared first on Puzzle Book.

]]>Continue reading "Knapsack Problem"

The post Knapsack Problem appeared first on Puzzle Book.

]]>In this Problem, we have two integer arrays value[0,1,2,…,n-1] and weight[0,1,2,3…,n-1],it represents the values and weights associated with n items resp. Given an integer W which represents the total capacity of the box. Write a Program to find the maximum value V which is the sum of the subset of values (value[]) such that the sum of the weight of this subset is smaller than or equal to W.

We either have to pick the complete gift item or don’t pick it.

Also known as 0-1 Knapsack Problem because we cannot split the item mentioned. Either we don’t pick the item (i.e 0) or pick the complete item (i.e 1).

Source: www.geeksforgeeks.org

Find Solution here

The post Knapsack Problem appeared first on Puzzle Book.

]]>