Lonely Integer

  • + 0 comments

    Without count/counter

    def lonelyinteger(a):
        # Write your code here
        new_arr=[]
        for item in a:
            if item in new_arr:
                new_arr.remove(item)
            else:
                new_arr.append(item)
        return new_arr[0]