mstar
7d63141f07
I'm a fucking idiot and made it harder for myself than it had to be Go's sorting function already takes care of the actual sort, I just had to tell it how two elements compare according to the rules
14 lines
155 B
Go
14 lines
155 B
Go
package util
|
|
|
|
func MaxI(x ...int) int {
|
|
if len(x) == 0 {
|
|
return 0
|
|
}
|
|
tmp := x[0]
|
|
for _, v := range x {
|
|
if tmp < v {
|
|
tmp = v
|
|
}
|
|
}
|
|
return tmp
|
|
}
|