A peak element is an element that is strictly greater than its neighbors.
+
+& nums) {
+ int left = 0, right = nums.size() - 1;
+ while (left < right) {
+ int mid = left + right >> 1;
+ if (nums[mid] > nums[mid + 1]) {
+ right = mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+ return left;
+ }
+};
+```
+
+#### Go
+
+```go
+func findPeakElement(nums []int) int {
+ left, right := 0, len(nums)-1
+ for left < right {
+ mid := (left + right) >> 1
+ if nums[mid] > nums[mid+1] {
+ right = mid
+ } else {
+ left = mid + 1
+ }
+ }
+ return left
+}
+```
+
+#### TypeScript
+
+```ts
+function findPeakElement(nums: number[]): number {
+ let [left, right] = [0, nums.length - 1];
+ while (left < right) {
+ const mid = (left + right) >> 1;
+ if (nums[mid] > nums[mid + 1]) {
+ right = mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+ return left;
+}
+```
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Solution/1768. Merge Strings Alternately/1768. Merge Strings Alternately.py b/Solution/1768. Merge Strings Alternately/1768. Merge Strings Alternately.py
new file mode 100644
index 0000000..ec9f181
--- /dev/null
+++ b/Solution/1768. Merge Strings Alternately/1768. Merge Strings Alternately.py
@@ -0,0 +1,3 @@
+class Solution:
+ def mergeAlternately(self, word1: str, word2: str) -> str:
+ return ''.join(a + b for a, b in zip_longest(word1, word2, fillvalue=''))
\ No newline at end of file
diff --git a/Solution/1768. Merge Strings Alternately/readme.md b/Solution/1768. Merge Strings Alternately/readme.md
new file mode 100644
index 0000000..5f79b5c
--- /dev/null
+++ b/Solution/1768. Merge Strings Alternately/readme.md
@@ -0,0 +1,129 @@
+
+
+# [1768. Merge Strings Alternately](https://leetcode.com/problems/merge-strings-alternately)
+
+
+- **comments**: true
+- **difficulty**: Easy
+- **rating**: 1166
+- **source**: Weekly Contest 229 Q1
+- **tags**:
+ - Two Pointers
+ - String
+---
+## Description
+
+
+
+You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.
+
+Return the merged string.
+
+
+Example 1:
+
+
+Input: word1 = "abc", word2 = "pqr"
+Output: "apbqcr"
+Explanation: The merged string will be merged as so:
+word1: a b c
+word2: p q r
+merged: a p b q c r
+
+
+Example 2:
+
+
+Input: word1 = "ab", word2 = "pqrs"
+Output: "apbqrs"
+Explanation: Notice that as word2 is longer, "rs" is appended to the end.
+word1: a b
+word2: p q r s
+merged: a p b q r s
+
+
+Example 3:
+
+
+Input: word1 = "abcd", word2 = "pq"
+Output: "apbqcd"
+Explanation: Notice that as word1 is longer, "cd" is appended to the end.
+word1: a b c d
+word2: p q
+merged: a p b q c d
+
+
+
+Constraints:
+
+
+ 1 <= word1.length, word2.length <= 100
+ word1 and word2 consist of lowercase English letters.
+
+
+
+
+## Solutions
+
+
+
+### Solution 1: Direct Simulation
+
+We traverse the two strings `word1` and `word2`, take out the characters one by one, and append them to the result string. The Python code can be simplified into one line.
+
+The time complexity is $O(m + n)$, where $m$ and $n$ are the lengths of the two strings respectively. Ignoring the space consumption of the answer, the space complexity is $O(1)$.
+
+
+
+#### Python3
+
+```python
+class Solution:
+ def mergeAlternately(self, word1: str, word2: str) -> str:
+ return ''.join(a + b for a, b in zip_longest(word1, word2, fillvalue=''))
+```
+
+#### Java
+
+```java
+class Solution {
+ public String mergeAlternately(String word1, String word2) {
+ int m = word1.length(), n = word2.length();
+ StringBuilder ans = new StringBuilder();
+ for (int i = 0; i < m || i < n; ++i) {
+ if (i < m) {
+ ans.append(word1.charAt(i));
+ }
+ if (i < n) {
+ ans.append(word2.charAt(i));
+ }
+ }
+ return ans.toString();
+ }
+}
+```
+
+#### C++
+
+```cpp
+class Solution {
+public:
+ string mergeAlternately(string word1, string word2) {
+ int m = word1.size(), n = word2.size();
+ string ans;
+ for (int i = 0; i < m || i < n; ++i) {
+ if (i < m) ans += word1[i];
+ if (i < n) ans += word2[i];
+ }
+ return ans;
+ }
+};
+```
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Solution/2300. Successful Pairs of Spells and Potions/2300. Successful Pairs of Spells and Potions.py b/Solution/2300. Successful Pairs of Spells and Potions/2300. Successful Pairs of Spells and Potions.py
new file mode 100644
index 0000000..ded2efd
--- /dev/null
+++ b/Solution/2300. Successful Pairs of Spells and Potions/2300. Successful Pairs of Spells and Potions.py
@@ -0,0 +1,7 @@
+class Solution:
+ def successfulPairs(
+ self, spells: List[int], potions: List[int], success: int
+ ) -> List[int]:
+ potions.sort()
+ m = len(potions)
+ return [m - bisect_left(potions, success / v) for v in spells]
\ No newline at end of file
diff --git a/Solution/2300. Successful Pairs of Spells and Potions/readme.md b/Solution/2300. Successful Pairs of Spells and Potions/readme.md
new file mode 100644
index 0000000..aaa897b
--- /dev/null
+++ b/Solution/2300. Successful Pairs of Spells and Potions/readme.md
@@ -0,0 +1,177 @@
+---
+comments: true
+difficulty: Medium
+edit_url: https://github.com/doocs/leetcode/edit/main/solution/2300-2399/2300.Successful%20Pairs%20of%20Spells%20and%20Potions/README_EN.md
+rating: 1476
+source: Biweekly Contest 80 Q2
+tags:
+ - Array
+ - Two Pointers
+ - Binary Search
+ - Sorting
+---
+
+
+
+# [2300. Successful Pairs of Spells and Potions](https://leetcode.com/problems/successful-pairs-of-spells-and-potions)
+
+[中文文档](/solution/2300-2399/2300.Successful%20Pairs%20of%20Spells%20and%20Potions/README.md)
+
+## Description
+
+
+
+You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the ith spell and potions[j] represents the strength of the jth potion.
+
+You are also given an integer success. A spell and potion pair is considered successful if the product of their strengths is at least success.
+
+Return an integer array pairs of length n where pairs[i] is the number of potions that will form a successful pair with the ith spell.
+
+
+Example 1:
+
+
+Input: spells = [5,1,3], potions = [1,2,3,4,5], success = 7
+Output: [4,0,3]
+Explanation:
+- 0th spell: 5 * [1,2,3,4,5] = [5,10,15,20,25]. 4 pairs are successful.
+- 1st spell: 1 * [1,2,3,4,5] = [1,2,3,4,5]. 0 pairs are successful.
+- 2nd spell: 3 * [1,2,3,4,5] = [3,6,9,12,15]. 3 pairs are successful.
+Thus, [4,0,3] is returned.
+
+
+Example 2:
+
+
+Input: spells = [3,1,2], potions = [8,5,8], success = 16
+Output: [2,0,2]
+Explanation:
+- 0th spell: 3 * [8,5,8] = [24,15,24]. 2 pairs are successful.
+- 1st spell: 1 * [8,5,8] = [8,5,8]. 0 pairs are successful.
+- 2nd spell: 2 * [8,5,8] = [16,10,16]. 2 pairs are successful.
+Thus, [2,0,2] is returned.
+
+
+
+Constraints:
+
+
+ n == spells.length
+ m == potions.length
+ 1 <= n, m <= 105
+ 1 <= spells[i], potions[i] <= 105
+ 1 <= success <= 1010
+
+
+
+
+## Solutions
+
+
+
+### Solution 1: Sorting + Binary Search
+
+We can sort the potion array, then traverse the spell array. For each spell $v$, we use binary search to find the first potion that is greater than or equal to $\frac{success}{v}$. We mark its index as $i$. The length of the potion array minus $i$ is the number of potions that can successfully combine with this spell.
+
+The time complexity is $O((m + n) \times \log m)$, and the space complexity is $O(\log n)$. Here, $m$ and $n$ are the lengths of the potion array and the spell array, respectively.
+
+
+
+#### Python3
+
+```python
+class Solution:
+ def successfulPairs(
+ self, spells: List[int], potions: List[int], success: int
+ ) -> List[int]:
+ potions.sort()
+ m = len(potions)
+ return [m - bisect_left(potions, success / v) for v in spells]
+```
+
+#### Java
+
+```java
+class Solution {
+ public int[] successfulPairs(int[] spells, int[] potions, long success) {
+ Arrays.sort(potions);
+ int n = spells.length, m = potions.length;
+ int[] ans = new int[n];
+ for (int i = 0; i < n; ++i) {
+ int left = 0, right = m;
+ while (left < right) {
+ int mid = (left + right) >> 1;
+ if ((long) spells[i] * potions[mid] >= success) {
+ right = mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+ ans[i] = m - left;
+ }
+ return ans;
+ }
+}
+```
+
+#### C++
+
+```cpp
+class Solution {
+public:
+ vector successfulPairs(vector& spells, vector& potions, long long success) {
+ sort(potions.begin(), potions.end());
+ vector ans;
+ int m = potions.size();
+ for (int& v : spells) {
+ int i = lower_bound(potions.begin(), potions.end(), success * 1.0 / v) - potions.begin();
+ ans.push_back(m - i);
+ }
+ return ans;
+ }
+};
+```
+
+#### Go
+
+```go
+func successfulPairs(spells []int, potions []int, success int64) (ans []int) {
+ sort.Ints(potions)
+ m := len(potions)
+ for _, v := range spells {
+ i := sort.Search(m, func(i int) bool { return int64(potions[i]*v) >= success })
+ ans = append(ans, m-i)
+ }
+ return ans
+}
+```
+
+#### TypeScript
+
+```ts
+function successfulPairs(spells: number[], potions: number[], success: number): number[] {
+ potions.sort((a, b) => a - b);
+ const m = potions.length;
+ const ans: number[] = [];
+ for (const v of spells) {
+ let left = 0;
+ let right = m;
+ while (left < right) {
+ const mid = (left + right) >> 1;
+ if (v * potions[mid] >= success) {
+ right = mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+ ans.push(m - left);
+ }
+ return ans;
+}
+```
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Solution/605. Can Place Flowers/605. Can Place Flowers.py b/Solution/605. Can Place Flowers/605. Can Place Flowers.py
new file mode 100644
index 0000000..9e84d99
--- /dev/null
+++ b/Solution/605. Can Place Flowers/605. Can Place Flowers.py
@@ -0,0 +1,19 @@
+class Solution:
+ def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
+ # Add empty plots at the start and at the end of the flowerbed to simplify edge case handling
+ flowerbed = [0] + flowerbed + [0]
+
+ # Iterate over each plot in the flowerbed starting from the first actual plot to the last
+ for i in range(1, len(flowerbed) - 1):
+ # Check if the current plot and its adjacent plots are empty
+ if sum(flowerbed[i - 1: i + 2]) == 0:
+ # Plant a flower in the current plot
+ flowerbed[i] = 1
+ # Decrement the count of flowers we need to plant
+ n -= 1
+ # If we have planted all required flowers, we can end early
+ if n == 0:
+ return True
+
+ # After checking all plots, decide if we were able to plant all flowers
+ return n <= 0
\ No newline at end of file
diff --git a/Solution/605. Can Place Flowers/readme.md b/Solution/605. Can Place Flowers/readme.md
new file mode 100644
index 0000000..0d0d734
--- /dev/null
+++ b/Solution/605. Can Place Flowers/readme.md
@@ -0,0 +1,111 @@
+
+
+
+
+# [605. Can Place Flowers](https://leetcode.com/problems/can-place-flowers)
+
+- **comments**: true
+- **difficulty**: Easy
+- **tags**:
+ - Greedy
+ - Array
+---
+
+## Description
+
+
+
+You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
+
+Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise.
+
+
+Example 1:
+Input: flowerbed = [1,0,0,0,1], n = 1
+Output: true
+
Example 2:
+Input: flowerbed = [1,0,0,0,1], n = 2
+Output: false
+
+
+Constraints:
+
+
+ 1 <= flowerbed.length <= 2 * 104
+ flowerbed[i] is 0 or 1.
+ - There are no two adjacent flowers in
flowerbed.
+ 0 <= n <= flowerbed.length
+
+
+
+
+## Solutions
+
+
+
+### Solution 1: Greedy
+
+We directly traverse the array $flowerbed$. For each position $i$, if $flowerbed[i]=0$ and its adjacent positions on the left and right are also $0$, then we can plant a flower at this position. Otherwise, we cannot. Finally, we count the number of flowers that can be planted. If it is not less than $n$, we return $true$, otherwise we return $false$.
+
+The time complexity is $O(n)$, where $n$ is the length of the array $flowerbed$. We only need to traverse the array once. The space complexity is $O(1)$.
+
+
+
+#### Python3
+
+```python
+class Solution:
+ def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
+ flowerbed = [0] + flowerbed + [0]
+ for i in range(1, len(flowerbed) - 1):
+ if sum(flowerbed[i - 1 : i + 2]) == 0:
+ flowerbed[i] = 1
+ n -= 1
+ return n <= 0
+```
+
+#### Java
+
+```java
+class Solution {
+ public boolean canPlaceFlowers(int[] flowerbed, int n) {
+ int m = flowerbed.length;
+ for (int i = 0; i < m; ++i) {
+ int l = i == 0 ? 0 : flowerbed[i - 1];
+ int r = i == m - 1 ? 0 : flowerbed[i + 1];
+ if (l + flowerbed[i] + r == 0) {
+ flowerbed[i] = 1;
+ --n;
+ }
+ }
+ return n <= 0;
+ }
+}
+```
+
+#### C++
+
+```cpp
+class Solution {
+public:
+ bool canPlaceFlowers(vector& flowerbed, int n) {
+ int m = flowerbed.size();
+ for (int i = 0; i < m; ++i) {
+ int l = i == 0 ? 0 : flowerbed[i - 1];
+ int r = i == m - 1 ? 0 : flowerbed[i + 1];
+ if (l + flowerbed[i] + r == 0) {
+ flowerbed[i] = 1;
+ --n;
+ }
+ }
+ return n <= 0;
+ }
+};
+```
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/LeetCode_75.gif b/assets/LeetCode_75.gif
new file mode 100644
index 0000000..086d269
Binary files /dev/null and b/assets/LeetCode_75.gif differ
diff --git a/assets/lc75.gif b/assets/lc75.gif
new file mode 100644
index 0000000..33044a3
Binary files /dev/null and b/assets/lc75.gif differ