@ Overlapping will occur when Lm = Lh +N, which means every N*(12/11) hours (for N = 0,1,2,3...). In other words, it will happen approximately every 1hr5mins27secs, starting at 00:00. In 24hours, this occurs a total of 24/(12/11) = 22..

You are given n real numbers in an array. A number in the array is called a decimal dominant if it occurs more than n/10 times in the array. Give an O(n) time algorithm to determine if the given array has a decimal dominant.

Implement a function getbits, that returns the(right adjusted) n bits that begin at position p of an integer. Assume bit position 0 is at the right end and that n and p are sensible positive values.

23 times

ReplyDelete@Dave 22 times a day if you only count the minute and hour hands overlapping.

ReplyDeleteif you have any explanation for your answer please do comment.

should be 24 times of the minute n hour hands !

ReplyDelete@anonymous can you please explain..

ReplyDeleteIf you start from 1 to 12 hours a day it overlaps 12 times and similarly for another 12 hours which makes it 24

ReplyDelete@ Overlapping will occur when Lm = Lh +N, which means every N*(12/11) hours (for N = 0,1,2,3...). In other words, it will happen approximately every 1hr5mins27secs, starting at 00:00. In 24hours, this occurs a total of 24/(12/11) = 22..

ReplyDeletedo give your explanations..

The hour and the minutes clock coincide every 1 hr 5 min as u said but i think it happens 24 times as shown below:

ReplyDeleteOO:00, 01:05, 02:10, 03:15, 04:20, 05:25, 06:30, 07:35, 08:40, 09:45, 10:50, 11:55, 12:00, 13:05, 14:10, 15:15, 16:20, 17:25, 18:30, 19:35, 20:40, 21:45, 22:50, 23:55..this adds up to 24 times..will you please explain which cases your algorithm leaves from above.

@above here are overlapping times :

ReplyDeleteam

12:00

1:05

2:11

3:16

4:22

5:27

6:33

7:38

8:44

9:49

10:55

pm

12:00

1:05

2:11

3:16

4:22

5:27

6:33

7:38

8:44

9:49

10:55