export default (arr) => {
if (arr.length < 2) return 0
let maxNum = 0
for (let i = arr.length - 1; i >= 0; i–) {
for (let j = 0; j < i; j++) {
if (arr[j] > arr[j + 1]) {
let temp = arr[j + 1]
arr[j + 1] = arr[j]
arr[j] = temp
}
}
if (i < arr.length - 1) {
maxNum = arr[i + 1] - arr[i] > maxNum ? arr[i + 1] - arr[i] : maxNum
}
}
return maxNum
}