fn indexOfMinMax(comptime T: type, slice: []const T) struct {
    index_min: usize,
    index_max: usize,
}

Finds the indices of the smallest and largest number in a slice. O(n). Returns an anonymous struct with the fields index_min and index_max. slice must not be empty.

Parameters

T: type,
slice: []const T,