easy c++ solution using binary search || self explanatory code
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int singleNonDuplicate(vector<int>& nums) {\n      int left=0;\n      int right=nums.size()-1;\n      while(left<right)  \n      {\n          int mid=(left+right)/2;\n          if(mid%2==1)\n          {\n              mid--;\n          }\n          if(nums[mid]!=nums[mid+1])\n          {\n              right=mid;\n          }\n          else{\n              left=mid+2;\n          }\n      }\n      return nums[left];\n    }\n};\n```
['C++']