Single Element in a Sorted Array | LeetCode | Java Code | Multiple Approaches

preview_player
Показать описание
Single Element in a Sorted Array LeetCode Java Solution. Given a sorted array consisting of integers. In this array, every element appears twice, except for one element which appears only once. Find this single element that appears only once.


For Example -

Example 1:

Input: [1, 1, 3, 3, 4, 5, 5]
Output: 4

Example 2:

Input: [1, 2, 2, 3, 3, 11, 11]
Output: 1


Example 3:

Input: [3, 3, 7, 7, 10, 11, 11]
Output: 10


NOTE - You have to solve this problem in O(log n) time complexity and
in O(1) space.

LeetCode May Challenge Day 12

Рекомендации по теме
Комментарии
Автор

Your way of explaining the solutions are simply amazing.

sushmasinghSS
Автор

The way you explain things is just awesome. May GOD bless you and give you whatever you want in your life. KEEP UP THE GOOD WORK!

tanmaythaker