STICNOT Video Editorial

Code:

node.sort(reverse=True)
weight.sort(reverse=True)

weight.insert(1,weight[0])

count = 0; j = 0
for i in range(n):
    if weight[i] > node[j]:
        count += 1
    else:
        j += 1

Link: