【每日一题20220509】刚好大你

def solution(nums: list, idx: int)-> int:
    # your code here
    for data in sorted(nums):
        if data > nums[idx]:
            return nums.index(data)
    return -1

assert solution([4, 1, 3, 5, 6], 0) == 3
assert solution([4, 1, 3, 5, 6], 4) == -1
assert solution([1, 3, 5, 2, 4], 0) == 3