Company: TCS codevita
Difficulty: medium
Bacteria Growth and Splitting You are a scientist working with bacteria cultures in a lab. You start with a single petri dish containing 1 gram worth of bacteria at the end of hour 0. Your goal is to manage the total bacteria weight over time to reach exactly X gram bacteria at the end of an hour. You have to MINIMISE the number of hours. Rules of Bacteria Growth And Splitting: Splitting Bacteria At the start of each hour, you can split any number of petri dishes into two. Splitting a dish divides bacteria weight into two equal halves. The splitting operation is INSTANT (does not take any time). For example, on start of hour h , if you have 4 dishes => [2g, 3g, 5g, 7g], if you decide to split the first 3 dishes you will have 7 dishes => [1g, 1g, 1.5g, 1.5g, 2.5g, 7g]. You can only split one petri dish once per hour (You cannot split an already split dish in the same hour). Bacteria Reproduction During each hour, every dish\'s bacteria weight increases by 1g, so a dish having X gram bac