https://leetcode.com/problems/maximum-gap/ Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements. You may ass
array=list(range(10)) random.shuffle(array) print(array) def func1(array,n): d,k={},n while k>0: maxnum,maxindex=-float("inf"),0 for index,value in enumerate(array): if index not in d: if value>=maxnum: maxnum=value maxindex=index d[maxind