...

/

DIY: Single Element in a Sorted Array

DIY: Single Element in a Sorted Array

Solve the interview question "Single Element in a Sorted Array" in this lesson.

Problem statement

In this problem, you are given an array of sorted integers in which all of the integers will appear twice, except one. Your task is to find that single integer, which will appear only once.

Please note that your solution will have a time complexity of O(logn)O(log n) and constant space complexity.

Access this course and 1400+ top-rated courses and projects.