argMax<T extends num> function
Returns the index of the largest element in the list
Implementation
int argMax<T extends num>(List<T> list) {
return list
.asMap()
.entries
.reduce(
(MapEntry<int, T> l, MapEntry<int, T> r) => l.value > r.value ? l : r)
.key;
}