Ad
  • Custom User Avatar

    I do not think that this solution is correct.
    It will overlook same-as items.

    Try this variable with it.
    numbers_list = [1, 2, 3, 3, 6, 7, 8, 9, 10, 12]

    "3" would be the first non-consecutive item.
    But the above function will choose "12"

    The check should be whether it is consecutive (+1) or not.