You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Leetcode-241. Different Ways To Add Parentheses](https://leetcode.com/problems/different-ways-to-add-parentheses/description/)|[c++](./leetcode/241.different-ways-to-add-parentheses.cpp), [python](./leetcode/241.different-ways-to-add-parentheses.py)|\-|\-|\-| - |
|[Leetcode-326. Power Of Three](https://leetcode.com/problems/power-of-three/description/)|[python](./leetcode/326.power-of-three.py), [c++](./leetcode/326.power-of-three.cpp)| O\(1\)| O\(1\)|\-| - |
76
77
|[Leetcode-342. Power Of Four](https://leetcode.com/problems/power-of-four/description/)|[python](./leetcode/342.power-of-four.py), [c++](./leetcode/342.power-of-four.cpp)| O\(1\)| O\(1\)|\-| - |
|[Leetcode-318. Maximum Product Of Word Lengths](https://leetcode.com/problems/maximum-product-of-word-lengths/description/)|[c++](./leetcode/318.maximum-product-of-word-lengths.cpp), [python](./leetcode/318.maximum-product-of-word-lengths.py)| O\(N^2\)| O\(N\)|\-| - |
|[Leetcode-342. Power Of Four](https://leetcode.com/problems/power-of-four/description/)|[python](./leetcode/342.power-of-four.py), [c++](./leetcode/342.power-of-four.cpp)| O\(1\)| O\(1\)|\-| - |
| Problem(34) | Solution | Time | Space | Note | Ref |
117
+
| Problem(35) | Solution | Time | Space | Note | Ref |
116
118
| ----- | ----- | ----- | ----- | ----- | ----- |
117
119
|[Leetcode-4. Median Of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/description/)|[python](./leetcode/4.median-of-two-sorted-arrays.py), [c++](./leetcode/4.median-of-two-sorted-arrays.cpp)| O\(log\(min\(M, N\)\)\)| O\(1\)|\-| - |
|[Leetcode-167. Two Sum Ii Input Array Is Sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/)|[c++](./leetcode/167.two-sum-ii-input-array-is-sorted.cpp), [python](./leetcode/167.two-sum-ii-input-array-is-sorted.py)| O\(N\)| O\(1\)|\-| - |
|[Leetcode-278. First Bad Version](https://leetcode.com/problems/first-bad-version/description/)|[python](./leetcode/278.first-bad-version.py), [c++](./leetcode/278.first-bad-version.cpp)| O\(logN\)| O\(1\)| Range; |[Video](https://youtu.be/xNzBpfqzYSg)|
|[Leetcode-374. Guess Number Higher Or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/description/)|[python](./leetcode/374.guess-number-higher-or-lower.py), [c++](./leetcode/374.guess-number-higher-or-lower.cpp)| O\(logN\)| O\(1\)| Standard | - |
|[Leetcode-215. Kth Largest Element In An Array](https://leetcode.com/problems/kth-largest-element-in-an-array/description/)|[python](./leetcode/215.kth-largest-element-in-an-array.py), [c++](./leetcode/215.kth-largest-element-in-an-array.cpp)| O\(N\) ~ O\(N^2\)| O\(1\)| QuickSelection | - |
// Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.
8
+
//
9
+
// Example 1:
10
+
//
11
+
// Input: nums = [3,0,1]
12
+
// Output: 2
13
+
// Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.
14
+
//
15
+
// Example 2:
16
+
//
17
+
// Input: nums = [0,1]
18
+
// Output: 2
19
+
// Explanation: n = 2 since there are 2 numbers, so all numbers are in the range [0,2]. 2 is the missing number in the range since it does not appear in nums.
20
+
//
21
+
// Example 3:
22
+
//
23
+
// Input: nums = [9,6,4,2,3,5,7,0,1]
24
+
// Output: 8
25
+
// Explanation: n = 9 since there are 9 numbers, so all numbers are in the range [0,9]. 8 is the missing number in the range since it does not appear in nums.
26
+
//
27
+
//
28
+
// Constraints:
29
+
//
30
+
// n == nums.length
31
+
// 1 <= n <= 104
32
+
// 0 <= nums[i] <= n
33
+
// All the numbers of nums are unique.
34
+
//
35
+
//
36
+
// Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity?
# Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.
8
+
#
9
+
# Example 1:
10
+
#
11
+
# Input: nums = [3,0,1]
12
+
# Output: 2
13
+
# Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.
14
+
#
15
+
# Example 2:
16
+
#
17
+
# Input: nums = [0,1]
18
+
# Output: 2
19
+
# Explanation: n = 2 since there are 2 numbers, so all numbers are in the range [0,2]. 2 is the missing number in the range since it does not appear in nums.
20
+
#
21
+
# Example 3:
22
+
#
23
+
# Input: nums = [9,6,4,2,3,5,7,0,1]
24
+
# Output: 8
25
+
# Explanation: n = 9 since there are 9 numbers, so all numbers are in the range [0,9]. 8 is the missing number in the range since it does not appear in nums.
26
+
#
27
+
#
28
+
# Constraints:
29
+
#
30
+
# n == nums.length
31
+
# 1 <= n <= 104
32
+
# 0 <= nums[i] <= n
33
+
# All the numbers of nums are unique.
34
+
#
35
+
#
36
+
# Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity?
0 commit comments