题解 | #牛牛分数组#
牛牛分数组
http://www.nowcoder.com/practice/c06794fa84e1468187585cba63d9cefb
package main
import "sort"
func splitArray( n int , a []int ) int {
sort.Ints(a)
min := 1 << 31
for i := 1; i < n; i++{
if a[i] - a[i-1] < min && a[i] - a[i-1] >= 0{
min = a[i] - a[i-1]
}
}
return min
}