Minimum Operations to Reach Threshold
You have a positive integer kk and an array numsnums initially containing only 1. You can perform the following operations any number of times:
-Increase the value of any element in the array by 1. -Duplicate any element in the array and append it to the end of the array.
Find the minimum number of operations needed to make the sum of the elements in the final array greater than or equal to k.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)