## In what situation you will get less wet getting to the car

It is raining, but you need to get to your car, which stands at the farthest end of the parking lot.  Will you run to it or not, if your goal is to get wet as little as possible? How will you behave if you have an umbrella?   In order to answer this…

## You are given three boxes

You are given three boxes: one of them contains a valuable prize, others contain nothing. You can choose any box, but you still do not know exactly where is the prize. One of the two boxes you have not selected will be opened and shown that it is empty. Currently, you can either leave…

## You are given three boxes

You are given three boxes: one of them contains a valuable prize, others contain nothing. You can choose any box, but you still do not know exactly where is the prize. One of the two boxes you have not selected will be opened and shown that it is empty. Currently, you can either leave…

## You are given three boxes and you need to define which one contains the prize

You are given three boxes: one of them contains a valuable prize, others contain nothing. You can choose any box, but you still do not know exactly where is the prize. One of the two boxes you have not selected will be opened and shown that it is empty. Currently, you can either leave…

## Can you explain the code ((n & (n – 1)) == 0)

Let’s start from the very beginning.   What does A & B == 0 mean?   Actually, it means that A and B do not contain single bits at the same positions. In case n & (n – 1) == 0, then n and n – 1 do not have common units.   What…