This commit is contained in:
Vombit
2026-05-28 12:06:43 +05:00
parent 801bafd8ba
commit 9ed84e35cf
2 changed files with 13 additions and 0 deletions

5
solutions/lc747.py Normal file
View File

@@ -0,0 +1,5 @@
class Solution:
def dominantIndex(self, nums: List[int]) -> int:
nums_s = sorted(nums)
return nums.index(nums_s[-1]) if nums_s[-1] >= nums_s[-2] * 2 else -1