static bool arrayContains(List<int>? array, int key) { if (array != null) { for (int c in array) { if (c == key) { return true; } } } return false; }