MaxBy¶
func MaxBy[T any, O cmp.Ordered](slice []T, selector func(T) O) *T
MaxBy returns a pointer to the element with the maximum value as determined by the selector function. Returns nil if the slice is empty.
func MaxBy[T any, O cmp.Ordered](slice []T, selector func(T) O) *T
MaxBy returns a pointer to the element with the maximum value as determined by the selector function. Returns nil if the slice is empty.