Company: Infosys__..
Difficulty: medium
Minimum Operations to Transform Problem Description There are two available operations: ADD_1: Increment an integer by 1. MULTIPLY_2: Multiply an integer by 2. You are given a list of integers, kValues . For each integer kValues[i] in the list, determine the minimum number of operations required to transform the number 0 into kValues[i] using only the two operations described above. Return a list containing the minimum number of operations for each corresponding value in kValues . Example Input: kValues = [8, 5, 3] Output: [4, 4, 3] Explanation: The minimum operations for each value are found as follows: To get 8: 0 → 1 → 2 → 4 → 8 . This path requires 1 'ADD_1' operation and 3 'MULTIPLY_2' operations, for a total of 4 operations. To get 5: 0 → 1 → 2 → 4 → 5 . This path requires 2 'ADD_1' operations and 2 'MULTIPLY_2' operations, for a total of 4 operations. To get 3: 0 → 1 → 2 → 3 . This path requires 2 'ADD_1' operations and 1 'M