Gewoon een notitie voor mijzelf, zo’n makkelijk stukje wat handig is voor m’n persoonlijke archief.
int? firstAvailable = Enumerable.Range(0, int.MaxValue).Except(myInts).FirstOrDefault();
Dit vindt dus de eerste int-value die niet voorkomt in ‘myInts’.
Credits: https://stackoverflow.com/a/8865806