def contient_doublon(t): """le tableau t contient-il un doublon ?""" s = 0 for x in t: if s & (1 << x) != 0: return True s = s | (1 << x) return False