Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d3fa92

Browse files
committed
Create README - LeetHub
1 parentb9c25c1 commit6d3fa92

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><ahref="https://leetcode.com/problems/single-element-in-a-sorted-array/">540. Single Element in a Sorted Array</a></h2><h3>Medium</h3><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 once</em>.</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><strongclass="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><strongclass="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+
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
20+
<li><code>0 &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
21+
</ul>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp