I want to test if a list contains consecutive integers and no repetition of numbers. For example, if I have
l = [1, 3, 5, 2, 4, 6]
It should re
def solution(A): counter = [0]*len(A) limit = len(A) for element in A: if not 1 <= element <= limit: return False else: if counter[element-1] != 0: return False else: counter[element-1] = 1 return True