Company: Barclays
Difficulty: medium
Maximize Consecutive Normal Readings A big bio-research project is going on. The scientists involved are testing a new serum. They are performing initial research on animals, noting the effects of the serum, before attempting trials on actual human beings. The main criterion in their test is body temperature. If the body temperature is above or below a certain parameter after receiving the serum, the scientists will note it as zero. If it is within the normal level, they will note it as one. After completing all the readings, they can change the abnormal body temperature back to a normal level, but only for K times, so that the possible number of consecutive normal readings is maximized. The scientists wish to find the number of different ways to change the readings so as to get the maximized consecutive normal reading. You are given all the readings of the scientists. Write an algorithm to find how many consecutive times the temperature reading can be of a normal level. Input Format T