Find the element that appears once in an array where every other element appears twice | function which find number ; applying the formula . ; driver code
def singleNumber ( nums ) : NEW_LINE INDENT return 2 * sum ( set ( nums ) ) - sum ( nums ) NEW_LINE DEDENT a = [ 2 , 3 , 5 , 4 , 5 , 3 , 4 ] NEW_LINE print ( int ( singleNumber ( a ) ) ) NEW_LINE a = [ 15 , 18 , 16 , 18 , 16 , 15 , 89 ] NEW_LINE print ( int ( singleNumber ( a ) ) ) NEW_LINE