<jupyter_start><jupyter_text>Given a set of numbers where all elements occur even number of times except one number, find the odd occurring number<jupyter_code>#Remeber any (number ^ 0)=number
#(same no.^ same no.)=0
def findodd(li):
    res=0
    for ele in li:
        res^=ele
    return res
li=[1,1,2,2,3,3,8]
findodd(li)<jupyter_output><empty_output><jupyter_text>You are given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in the list. One of the integers is missing in the list. Write an efficient code to find the missing integer.<jupyter_code>def findno(li):
    
    res1=0
    for ele in li:
        res1^=ele
    
    for i in range(1,len(li)+2):
        res1^=i
        
    return res1

li=[1,2,3,4,6]
findno(li)
#a memory efficient doubly linked list application of bitwise xor operator<jupyter_output><empty_output><jupyter_text>Find the two non-repeating elements in an array of repeating elements<jupyter_code>def findOdd(li,size):
    
    xor=0
    x=0
    y=0
    for ele in li:
        xor^=ele
    set_bit=xor & ~(xor-1)
    
    for i in range(size):
        if (li[i] & set_bit):
            x^=li[i]
        else:
            y^=li[i]
    print(x,y)
    
li=[int(x) for x in input().split()]
findOdd(li,len(li))<jupyter_output>1 2 1 2 3 5
3 5
{'fraction_non_alphanumeric': 0.10562310030395136, 'fraction_numerical': 0.02735562310030395, 'mean_word_length': 2.9788519637462234, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '443375', 'license': 'Apache-2.0', 'n_tokens_mistral': 504, 'n_tokens_neox': 483, 'n_words': 155, 'path': 'XOR_questions.ipynb', 'repo_name': 'priyanshu-coder/Coding-Practise', 'size': '1316'}