There are 4 big houses in my home town. They are made from these materials: red marbles, green marbles, white marbles and blue marbles.
Mrs Jennifer's house is somewhere to the left of the green marbles one and the third one along is white marbles.
Mrs Sharon owns a red marbles house and Mr Cruz does not live at either end, but lives somewhere to the right of the blue marbles house.
Mr Danny lives in the fourth house, while the first house is not made from red marbles.
Who lives where, and what is their house made from ?
From, left to right:
#1 Mrs Jennifer - blue marbles
#2 Mrs Sharon - red marbles
#3 Mr Cruz - white marbles
#4 Mr Danny - green marbles
If we separate and label the clues, and label the houses #1, #2, #3, #4 from left to right we can see that:
a. Mrs Jennifer's house is somewhere to the left of the green marbles one.
b. The third one along is white marbles.
c. Mrs Sharon owns a red marbles house
d. Mr Cruz does not live at either end.
e. Mr Cruz lives somewhere to the right of the blue marbles house.
f. Mr Danny lives in the fourth house
g. The first house is not made from red marbles.
By (g) #1 isn't made from red marbles, and by (b) nor is #3. By (f) Mr Danny lives in #4 therefore by (c) #2 must be red marbles, and Mrs Sharon lives there.
Therefore by (d) Mr Cruz must live in #3, which, by (b) is the white marbles house. By (a) #4 must be green marbles (otherwise Mrs Jennifer couldn't be to its left) and by (f) Mr Danny lives there.
Which leaves Mrs Jennifer, living in #1, the blue marbles house.
See also best riddles or new riddles.cleanfunnylogicshort
A kind hearted person Mr. Rawat buy packed food at 3$/packet from United states and sells them at 1$/packet at Africa. After some time he becomes a millionaire. How come the guy become millionaire?
He started out as a billionaire, but lost so much money in his good works (by giving to poor people) that he became a millionaire.logicshort
What has many keys but can't open any doors?
What is represented by this BrainBat Pattern?
EST EST EST EST
Would you have more money with a million dollars today or a penny today and double your money every day for 31 days?
Second option. Double your money every day for 31 days.logicmath
Two words are anagrams if and only if they contain the exact same letters with the exact same frequency (for example, "name" and "mean" are anagrams, but "red" and "deer" are not).
Given two strings S1 and S2, which each only contain the lowercase letters a through z, write a program to determine if S1 and S2 are anagrams. The program must have a running time of O(n + m), where n and m are the lengths of S1 and S2, respectively, and it must have O(1) (constant) space usage.
First create an array A of length 26, representing the counts of each letter of the alphabet, with each value initialized to 0. Iterate through each character in S1 and add 1 to the corresponding entry in A. Once this iteration is complete, A will contain the counts for the letters in S1. Then, iterate through each character in S2, and subtract 1 from each corresponding entry in A. Now, if the each entry in A is 0, then S1 and S2 are anagrams; otherwise, S1 and S2 aren't anagrams.
Here is pseudocode for the procedure that was described:
def areAnagrams(S1, S2)
A = new Array(26)
for each character in S1
arrayIndex = mapCharacterToNumber(character) //maps "a" to 0, "b" to 1, "c" to 2, etc...
A[arrayIndex] += 1
for each character in S2
arrayIndex = mapCharacterToNumber(character)
A[arrayIndex] -= 1
for (i = 0; i < 26; i++)
if A[i] != 0
Hockey Stick and ball cost $50. If the Stick cost $49 more than the ball. What is the cost of each ?
Hockey Stick $49.50 & ball $0.50.logicmath
Every day, Jack arrives at the train station from work at 5 pm. His wife leaves home in her car to meet him there at exactly 5 pm, and drives him home. One day, Jack gets to the station an hour early, and starts walking home, until his wife meets him on the road. They get home 30 minutes earlier than usual. How long was he walking? Distances are unspecified. Speeds are unspecified, but constant. Give a number which represents the answer in minutes.
The best way to think about this problem is to consider it from the perspective of the wife. Her round trip was decreased by 30 minutes, which means each leg of her trip was decreased by 15 minutes. Jack must have been walking for 45 minutes.cleanlogicshort
If you have me, you want to share me. If you share me, you haven't got me. What am I?
A crime has been committed at Freemont Street. The main suspect is a man named Sean Baker. It was said that a man had been walking along the pathway when he was suddenly shot in the stomach. The suspect had brown hair, blue eyes and wore a baggy Armani suit just like Sean Baker's. Sean was asked to tell the story right from the beginning. "Well," said Sean, "I was just hanging around the park when I saw this man walking along the pathway. Suddenly, a guy came up from behind him and shot him! I ran home as fast as I could. The policemen asked him to give a description of the murderer. "He had a red mustache, red hair and a baggy Armani suit on."
"I think this man is telling a lie," said one of the policemen. How did he know?
How can the murderer shoot him in the stomach if he came up behind the man?cleanlogicshort
I live in every part of your body and all commodities are transacted through me! I appear the same, but different!