I am a 8 Letter Word.
I am kept Secret from Everyone.
My 2nd, 3rd, 4th Letter Spell an Animal.
My 4th, 5th, 6th, 7th, 8th Letter is a Weapon.
My 1st, 2nd, 8th Letter is used for Writing an Exam.
My 3rd, 4th Letters are the Same.
“Guess What Am I” ???
If you have not tried its simpler version, try that first click here for Who is the thief puzzle part 1
A horse, a donkey and a camel were stolen.
Three suspects: Robert, Scott and Tommy. All we know that each person stole one animal, but we do not know who stole which. Here are the investigation statements.
Robert: Tommy stole the horse.
Scott: Tommy stole the donkey.
Tommy: They both were lying. I did not steal the horse or the donkey.
Later on, police found out =>
The man who stole the camel told a lie.
The man who stole the horse told the truth.
Can you find out who stole which?
Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the second problem from Online Round 1B 2013, top 1000 from this round will be eligible for next online round.
Diamonds are falling from the sky. People are now buying up locations where the diamonds can land, just to own a diamond if one does land there. You have been offered one such place, and want to know whether it is a good deal.
Diamonds are shaped like, you guessed it, diamonds: they are squares with vertices (X-1, Y), (X, Y+1), (X+1, Y) and (X, Y-1) for some X, Y which we call the center of the diamond. All the diamonds are always in the X-Y plane. X is the horizontal direction, Y is the vertical direction. The ground is at Y=0, and positive Y coordinates are above the ground.
The diamonds fall one at a time along the Y axis. This means that they start at (0, Y) with Y very large, and fall vertically down, until they hit either the ground or another diamond.
When a diamond hits the ground, it falls until it is buried into the ground up to its center, and then stops moving. This effectively means that all diamonds stop falling or sliding if their center reaches Y=0.
When a diamond hits another diamond, vertex to vertex, it can start sliding down, without turning, in one of the two possible directions: down and left, or down and right. If there is no diamond immediately blocking either of the sides, it slides left or right with equal probability. If there is a diamond blocking one of the sides, the falling diamond will slide to the other side until it is blocked by another diamond, or becomes buried in the ground. If there are diamonds blocking the paths to the left and to the right, the diamond just stops.
Consider the example in the picture. The first diamond hits the ground and stops when halfway buried, with its center at (0, 0). The second diamond may slide either to the left or to the right with equal probability. Here, it happened to go left. It stops buried in the ground next to the first diamond, at (-2, 0). The third diamond will also hit the first one. Then it will either randomly slide to the right and stop in the ground, or slide to the left, and stop between and above the two already-placed diamonds. It again happened to go left, so it stopped at (-1, 1). The fourth diamond has no choice: it will slide right, and stop in the ground at (2, 0).
9 digit number puzzle
There is a 9 digit number. No digit are repeated and rightmost digit is divisible by 1 and right 2 digits is divisible by 2, right 3 digits is divisible by 3 and so on, finally the whole number is divisible by 9.
Can you find out the number?See Solution
Now, Right 4 digits are divisible by 4, so the rightmost two digits can be either 20, 40, 80 or 60.
To be divisible by 9 the digits of a number must sum to a multiple of 9. Adding the 10 digits together (0+1+2+…+8+9) gives 45 which is div by 9. However, this is a 9-digit number so we have to drop one from the ten. We can only take out 0 or 9 and still have the remaining digits sum to a multiple of 9. We’ve already shown that 0 is present so the 9 is dropped.
Right 3 digits are divisible by 3 so these 3 digits can be 120, 420, 720, 240, 540, 840, 180, 480, 780, 360.
Now to be divisible by 6 sum of the six digits should be divisible by 3 and it should also be even, which it is.
There is no rule for divisible by 7 so we just have to take digits such that they are divisible by 7, there can be many such numbers and one such number is 123567480.
Their are 10 prisoners in a jail for a minor crime, they all request the jail officer to set them free, jail officer agrees to release them tomorrow, saying i will
- Make you all stand in a queue in ascending order of your heights(smallest first).
- You will not be allowed to turn your head(they have to look straight)
- I will put one hat on your head, either BLACK or WHITE in color.
- Everyone of you has to tell the color of his hat starting from the tallest prisoner, you can only say BLACK or WHITE.
- You all will be released, if and only if at least 9 of you guess your hat’s color correctly.
Can you suggest a strategy to the prisoners to maximize the chances of their release?
four glasses on a square table puzzle, also known as the blind bartender’s problem
Four glasses are placed on the corners of a square table. Some of the glasses are upright (up) and some upside-down (down). You have to arrange the glasses so that they are all up or all down (while keeping your eyes closed all the time). The glasses may be re-arranged in turns subject to the following rules.
- Any two glasses may be inspected in one turn and after feeling their orientation you may reverse the orientation of either, neither or both glasses.
- After each turn table is rotated through a random angle.
- At any point of time if all four glasses are of the same orientation a ring will bell
You have to come up with a solution to ensure that all glasses have the same orientation (either up or down) in a finite number of turns. The algorithm must be non-stochastic i.e. it must not depend on luck.
Most of us are familiar with google codejam, those who don’t visit https://code.google.com/codejam for more information. This is the third problem from Qualification Round 2013.
Little John likes palindromes, and thinks them to be fair (which is a fancy word for nice). Apalindrome is just an integer that reads the same backwards and forwards – so 6, 11 and 121 are all palindromes, while 10, 12, 223 and 2244 are not (even though 010=10, we don’t consider leading zeroes when determining whether a number is a palindrome).
He recently became interested in squares as well, and formed the definition of a fair and square number – it is a number that is a palindrome and the square of a palindrome at the same time. For instance, 1, 9 and 121 are fair and square (being palindromes and squares, respectively, of 1, 3 and 11), while 16, 22 and 676 are not fair and square: 16 is not a palindrome, 22 is not a square, and while 676 is a palindrome and a square number, it is the square of 26, which is not a palindrome.
Now he wants to search for bigger fair and square numbers. Your task is, given an interval Little John is searching through, to tell him how many fair and square numbers are there in the interval, so he knows when he has found them all.
IF FMJNT and FWPM are the code of SMILE and LOVE resptively. What will be the code of HAPPY?
Check your answer: Enter A, B, C or D
Given an integer array of length N, containing values in the range 1,2,3…N^2. Sort the array in O(N) time.