本题未写代码,只写了注释,练一下英语。
* float values in an array, get the max subtraction between 2 adjacent items by value(not by index).
** Be careful, O(n) and O(n)
*
* 1) find the min and max, get the v1 = floor(min) and v2 = ceiling(max).
* 2) new buckets between v1 and v2, interval is 1.
* 3) go through array and mark the buckets, if bucket is not empty, it is 1, else 0.
* 4) go through buckets, find the 2 buckets A and B that qualify :
* a) both not empty
* b) interval buckets are all empty.
* c) length of interval buckets is longest.
* d) if all items in only one bucket, it means A==B, keep going same steps below.
* 5) go through array, find the item in A which is max.
* 6) go through array, find the item in B which is min.
* 7) get their subtraction, that it is.