Handle Score
@Ibrahim Nash 6381
@blackshadows 6329
@mb1973 5388
@Quandray 5231
@akhayrutdinov 5111
@saiujwal13083 4510
@sanjay05 3762
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3357
@KshamaGupta 3318
Complete Leaderboard
Large Product-2
Medium Accuracy: 66.67% Submissions: 3 Points: 4

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)


1 <= n <= 10000
1 <= numsi <= 100

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Large Product-2

Output Window