Company: Meesho_1aug
Difficulty: medium
Power limit Problem Description Two power resources, with charge levels A and B, feed a piece of software. Each second, you must pick one of the two resources to power the software, and the resource you pick must currently have a charge level greater than 1. After a resource is picked, its own charge drops by 2 for that second, while the charge of the resource you did not pick rises by 1. The software halts as soon as either resource's charge reaches 0. You are given integers A and B Determine the greatest number of seconds the software can keep running if you pick resources in the best possible way. Function description Complete the function powerLimit() . This function takes the following 2 parameters and returns the required answer. A Represents the power of the first resource B Represents the power of the second resource Input format Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code The first li