filmov
tv
Single Number - Leetcode #136 Using Bitwise Operators
![preview_player](https://i.ytimg.com/vi/wyZhBVDLa7s/maxresdefault.jpg)
Показать описание
In this problem we have given an array of integers and every element in this array is repeated except one element , we need to find this element.
We are solving this problem with bitwise operators, property of XOR operator is (A ^ A = 0) so we will use this property to solve this problem in very optimal way.
Time complexity - O ( N )
Space Complexity - O ( 1 )
We are solving this problem with bitwise operators, property of XOR operator is (A ^ A = 0) so we will use this property to solve this problem in very optimal way.
Time complexity - O ( N )
Space Complexity - O ( 1 )