bottomElements method

List<num> bottomElements(
  1. int k
)

Returns the k least elements of given set.

Implementation

List<num> bottomElements (int k) {
  var copy = toList(growable: false);
  copy.sort();
  return copy.sublist(0, k);
}