@lixx2100 If there are only non-negtive numbers, how to solve it in O(n)? Could you please explain?