Python 5 line


  • 0
    G
    dp, res = [], 0
    for i in xrange(len(nums) - 1, -1, -1):
        res += bisect_left(dp, nums[i])
        insort(dp, 2*nums[i])
    return res
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.