C++ 100% Beats.
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        // Initialize the left and right pointers\n        int l = 0;\n        int r = nums.size() - 1;\n\n        while (l < r) {\n            // Set the value of mid\n            int mid = l + (r - l) / 2;\n\n            // If mid is odd, decrement it to make it even\n            if (mid % 2 == 1) {\n                mid--;\n            }\n\n            // If the elements at mid and mid + 1 are the same,\n            // then the single element must appear after the midpoint\n            if (nums[mid] == nums[mid + 1]) {\n                l = mid + 2;\n            }\n            // Otherwise, we must search for the single element before the\n            \n            else {\n                r = mid;\n            }\n        }\n\n        return nums[l];\n    }\n};\n```
['C++']