Python3 program to find the repeating and missing elements using Maps
def main ( ) : NEW_LINE INDENT arr = [ 4 , 3 , 6 , 2 , 1 , 1 ] NEW_LINE numberMap = { } NEW_LINE max = len ( arr ) NEW_LINE for i in arr : NEW_LINE INDENT if not i in numberMap : NEW_LINE INDENT numberMap [ i ] = True NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Repeating ▁ = " , i ) NEW_LINE DEDENT DEDENT for i in range ( 1 , max + 1 ) : NEW_LINE INDENT if not i in numberMap : NEW_LINE INDENT print ( " Missing ▁ = " , i ) NEW_LINE DEDENT DEDENT DEDENT main ( ) NEW_LINE