Skip to content

Commit 6d3fa92

Browse files
committed
Create README - LeetHub
1 parent b9c25c1 commit 6d3fa92

File tree

1 file changed

+21
-0
lines changed
  • 0540-single-element-in-a-sorted-array

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<h2><a href="https://leetcode.com/problems/single-element-in-a-sorted-array/">540. Single Element in a Sorted Arraya>h2><h3>Mediumh3><hr><p>You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.p>
2+
3+
<p>Return <em>the single element that appears only onceem>.p>
4+
5+
<p>Your solution must run in <code>O(log n)code> time and <code>O(1)code> space.p>
6+
7+
<p>&nbsp;p>
8+
<p><strong class="example">Example 1:strong>p>
9+
<pre><strong>Input:strong> nums = [1,1,2,3,3,4,4,8,8]
10+
<strong>Output:strong> 2
11+
pre><p><strong class="example">Example 2:strong>p>
12+
<pre><strong>Input:strong> nums = [3,3,7,7,10,11,11]
13+
<strong>Output:strong> 10
14+
pre>
15+
<p>&nbsp;p>
16+
<p><strong>Constraints:strong>p>
17+
18+
<ul>
19+
  • 1 <= nums.length <= 105
  • 20+
  • 0 <= nums[i] <= 105
  • 21+
    ul>

    0 commit comments

    Comments
     (0)