Start your brain! Exercise wisdom questions 7 every Monday

Source: Internet
Author: User

1,
James was out of school early today. He walked home for 10 minutes and met his father who was driving his car to pick him up. So he got on the bus and went home, but he still went home one minute later, the reason is that Dad got off work seven minutes late today. Can James leave school a few minutes in advance today?

Answer: James's father got off work 7 minutes late, and then picked him up, but only went home one minute later. It means that on the road to pick up James, he walked less than twice the 10-minute journey (round-trip), and spent less than 6 minutes. Therefore, the distance between the two persons and the school is 3 minutes. (6 minutes in total ). That is to say, it will take three minutes for the car to arrive at school. Dad leaves work 7 minutes later-these 3 minutes = the time when the car was late than usual
: 4 minutes. Assume that the school is out of school n minutes in advance, and n + 4 = 10. Therefore, James leaves school 6 minutes in advance.

2,
An array of N in size, all numbers are positive integers that do not exceed the N-1. Use the O (N) Time to find the number of duplicates (assuming there is only one ). An array of N in size. All numbers are positive integers not greater than N + 1. Use the O (N) Time to find the number that has not appeared (assuming there is only one ).

Answer: Calculate the sum of all the numbers in the array, and then calculate the sum of all the numbers from 1 to the N-1, the difference between the two is the repeated number. Calculate the sum of all numbers in the array, and then calculate the sum of all numbers from 1 to N + 1. The difference between the two is the missing number.

3,
At dusk of a winter day, I was walking on the street and suddenly heard a gun. I saw an old man falling to the door not far away and slowly fell down. The only two people on the street and I ran past and found that the old man had a bullet in his back and died. I saw two people wearing gloves and asked them what they were doing.
The first person said, "I saw the old man coming to lock the door. As soon as the gun rang, he fell in response and I ran immediately ." The second said: "I heard gunshots and I don't know what happened. When I saw you running here, I followed ."
The key is still in the lock of the door. I open the door, enter the room, and call the police.
When a police officer arrived, I pointed to a person and said, "Hold him down and ask ."
Who is in custody? Why?

Answer: detain the first speaker. He knows that the old man locks the door rather than opens the door, indicating that he has been watching the old man.

4,
How many points on the earth make it take a mile from this point to the south, a mile to the east, and then a mile to the north to return to the starting point?

Answer: "North Point" is a traditional answer. In fact, there are other answers to this question. In fact, there are infinite vertices that meet the requirements. All the places that are 1 + 1/(2 π) miles from the South Pole meet the requirements, and walk one mile south to reach 1/(2 π) from the South Pole, take a mile to the east and then round the latitude circle for a week. Then, go north to the original path and return to the starting point. In fact, this is still not all the points that meet the requirements. The distance from the South Pole 1 + 1/(2 k π) is acceptable, where k can be any positive integer.

5,
Append space with linear time and constants to reverse the words (not characters) in an article.

Answer: first, sort all the characters in the entire article in reverse order (starting from the two ends and constantly exchanging characters with relative names). Then, use the same method to sort the characters in each word in reverse order. In this way, the word order in the entire article is reversed, but the word itself is reversed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.