mode method

int mode()

Implementation

int mode() {
  Map<int, int> map = occurrences();
  int max = 0;
  int mode = 0;
  for (int key in map.keys) {
    if (map[key]! > max) {
      max = map[key]!;
      mode = key;
    }
  }
  return mode;
}