Hello,
I got this puzzle asked to me in a recent interview in an MNC company.
Suppose you are working in a tv channel and your job is to schedule the advertisements in between the TV program breaks.
You have to show Advt A 6 times and Advt B 2 times in 30 minutes slot.
Suppose both advt are 1 minute each.
Now you have to schedule these advt such that the advt of same kind are as far as possible. No more clues and no more clarification I can provide more than what I have given because this is what I was asked exactly.
And this is the problem the company is working on and trying to find an algorith for this.

I have a question here,

only 8 breaks. you have to schedule six A advt and two B advt in 30 minutes.

I prefer to go for only 6 breaks,
Let us say the program starts at 8 AM and ends at 8:30 AM

Hi james,
Look I dont have the correct solution with me but I would like to know that how you came up with this solution and is this the optimum solution?

Originally Posted by jamesravid
I prefer to go for only 6 breaks,
Let us say the program starts at 8 AM and ends at 8:30 AM

for better user experience.Add "b" should in b/w add"A", add "A" should not be in every break continuously?

First, the puzzle clearly states that two ads of the same type should be as far as possible.
So this clearly means that 1st B type ad should be before program begins and last B type ad should be when program ends.

Secondly, the rest of the ads should be kept at similar distance.

Thirdly, 1st A type ad can be at the beginning along with 1st B type of ad.

Fourthly, last A type ad should be placed along with last B type ad after program ends.

The remaining 4 A type ads can be scattered in between.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•