Skip to content
This repository was archived by the owner on Sep 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Created bitwise algorithms
  • Loading branch information
suvanbalu committed Sep 14, 2021
commit e00980a3f0667c8c8630325bb9dfcd934641688f
11 changes: 11 additions & 0 deletions algorithms/bit manipulation/twice_unique.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def twice_unique(arr:list) :
unique = 0
for i in arr:
unique ^= i
return unique
if __name__=="__main__":
array = list(map(int,input().split()))
#sample input
# 1 2 2 3 4 4 3
element = twice_unique(array)
print(f"Unique element in the array {array} is {element}")
3 changes: 0 additions & 3 deletions algorithms/bit manipulation/xor_swap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from typing import List


def swap(a:int,b:int) -> list :
a=a^b
b=b^a
Expand Down