最后好像是min(num[length-1],num[length-2])