Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5701 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 938 |
@bt8816103042 | 739 |
@SHOAIBVIJAPURE | 428 |
@codeantik | 412 |
@SherlockHolmes3 | 407 |
@neverevergiveup | 348 |
@mahlawatep | 347 |
@shalinibhataniya1097 | 343 |
@murarry3625 | 333 |
@saiujwal13083 | 326 |
@rohitanand | 314 |
Complete Leaderboard |
In a town , the Chief Council of Ministers has decided to contribute funds raised from various sources in their department for the Central Public Welfare Initiatives. Given the contribution of n ministers numsi, where i represents the contribution of the ith minister, what should be the least contribution from the chief such that the nth power of his share is atleast equal to the product of contributions of all his subordinates.
Example 1:
Input: nums = {3, 2, 1, 5}
Output: 3
Explanation: 34 >= 3*2*1*5 = 30
Example 2:
Input: nums = {2}
Output: 2
Explanation: 21 >= 2
Your Task:
You don't need to read or print anything. Your task is to complete the function Find() which takes list nums as input parameter and returns the minimum contribution such that it's nth power is atleast equal to the product of contributions of all sunordinates of Chief.
Expected Time Complexity: O(nlog(n))
Expected Space Complexity: O(1)
Constraints:
1 <= n <= 10000
1 <= numsi <= 100
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes