diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md" index 5dfd5611b39f8..51bbba1bf33c2 100644 --- "a/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md" +++ "b/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md" @@ -222,28 +222,28 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode { * init(_ val: Int, _ next: ListNode?) { self.val = val; self.next = next; } * } */ - + class Solution { func addTwoNumbers(_ l1: ListNode?, _ l2: ListNode?) -> ListNode? { var s1: [Int] = [] var s2: [Int] = [] - + var node1 = l1 var node2 = l2 - + while let n1 = node1 { s1.append(n1.val) node1 = n1.next } - + while let n2 = node2 { s2.append(n2.val) node2 = n2.next } - + var carry = 0 let dummy: ListNode? = ListNode(0) - + while !s1.isEmpty || !s2.isEmpty || carry != 0 { carry += (s1.isEmpty ? 0 : s1.removeLast()) + (s2.isEmpty ? 0 : s2.removeLast()) let node = ListNode(carry % 10) @@ -251,7 +251,7 @@ class Solution { dummy?.next = node carry /= 10 } - + return dummy?.next } } diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md" index b91b7a0cb6b6d..8b6a62a3c4e60 100644 --- "a/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md" +++ "b/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md" @@ -305,15 +305,15 @@ func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode { class Solution { func reorderList(_ head: ListNode?) { guard let head = head else { return } - + let mid = middleNode(head) - + let secondHalf = reverseList(mid.next) mid.next = nil - + mergeTwoLists(head, secondHalf) } - + private func middleNode(_ head: ListNode?) -> ListNode { var slow = head var fast = head @@ -323,7 +323,7 @@ class Solution { } return slow! } - + private func reverseList(_ head: ListNode?) -> ListNode? { var prev: ListNode? = nil var curr = head @@ -335,20 +335,20 @@ class Solution { } return prev } - + private func mergeTwoLists(_ l1: ListNode?, _ l2: ListNode?) { var l1 = l1 var l2 = l2 while l1 != nil && l2 != nil { let l1Next = l1?.next let l2Next = l2?.next - + l1?.next = l2 if l1Next == nil { break } l2?.next = l1Next - + l1 = l1Next l2 = l2Next } diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md" index ac1df6f56a98e..656c43eadb7be 100644 --- "a/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md" +++ "b/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md" @@ -223,12 +223,12 @@ public: class RandomizedSet { private var m: [Int: Int] private var a: [Int] - + init() { self.m = [Int: Int]() self.a = [Int]() } - + func insert(_ val: Int) -> Bool { if m[val] != nil { return false @@ -237,7 +237,7 @@ class RandomizedSet { a.append(val) return true } - + func remove(_ val: Int) -> Bool { if let idx = m[val] { let last = a.count - 1 @@ -251,7 +251,7 @@ class RandomizedSet { } return false } - + func getRandom() -> Int { return a[Int.random(in: 0.. [[String]] { var d = [String: [String]]() - + for s in strs { let sortedStr = String(s.sorted()) if d[sortedStr] == nil { @@ -172,7 +172,7 @@ class Solution { } d[sortedStr]!.append(s) } - + return Array(d.values) } } diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md" index 975e0edc9b000..5b7c78e2d56ca 100644 --- "a/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md" +++ "b/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md" @@ -205,21 +205,21 @@ function isAlienSorted(words: string[], order: string): boolean { class Solution { func isAlienSorted(_ words: [String], _ order: String) -> Bool { var index = [Character: Int]() - + for (i, char) in order.enumerated() { index[char] = i } - + for i in 0..= l1 ? -1 : index[w1[j]]! let i2 = j >= l2 ? -1 : index[w2[j]]! - + if i1 > i2 { return false } diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md" index cd05e47cc18be..fc4eeadfe7e8d 100644 --- "a/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md" +++ "b/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md" @@ -175,22 +175,22 @@ class Solution { if timePoints.count > 24 * 60 { return 0 } - + var mins = [Int]() - + for t in timePoints { let time = t.split(separator: ":").map { Int($0)! } mins.append(time[0] * 60 + time[1]) } - + mins.sort() mins.append(mins[0] + 24 * 60) - + var ans = Int.max for i in 1.. a - b); -} -``` - #### Rust ```rust impl Solution { pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { - let (mut m, mut n) = (m as usize, n as usize); - for i in (0..m + n).rev() { - nums1[i] = match (m == 0, n == 0) { - (true, false) => { - n -= 1; - nums2[n] - } - (false, true) => { - m -= 1; - nums1[m] - } - (_, _) => { - if nums1[m - 1] > nums2[n - 1] { - m -= 1; - nums1[m] - } else { - n -= 1; - nums2[n] - } - } - }; + let mut k = (m + n - 1) as usize; + let mut i = (m - 1) as isize; + let mut j = (n - 1) as isize; + + while j >= 0 { + if i >= 0 && nums1[i as usize] > nums2[j as usize] { + nums1[k] = nums1[i as usize]; + i -= 1; + } else { + nums1[k] = nums2[j as usize]; + j -= 1; + } + k -= 1; } } } diff --git a/solution/0000-0099/0088.Merge Sorted Array/README_EN.md b/solution/0000-0099/0088.Merge Sorted Array/README_EN.md index 75284b1fbf7b8..996443e09109f 100644 --- a/solution/0000-0099/0088.Merge Sorted Array/README_EN.md +++ b/solution/0000-0099/0088.Merge Sorted Array/README_EN.md @@ -154,46 +154,24 @@ function merge(nums1: number[], m: number, nums2: number[], n: number): void { } ``` -#### TypeScript - -```ts -/** - Do not return anything, modify nums1 in-place instead. - */ -function merge(nums1: number[], m: number, nums2: number[], n: number): void { - nums1.length = m; - nums2.length = n; - nums1.push(...nums2); - nums1.sort((a, b) => a - b); -} -``` - #### Rust ```rust impl Solution { pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { - let (mut m, mut n) = (m as usize, n as usize); - for i in (0..m + n).rev() { - nums1[i] = match (m == 0, n == 0) { - (true, false) => { - n -= 1; - nums2[n] - } - (false, true) => { - m -= 1; - nums1[m] - } - (_, _) => { - if nums1[m - 1] > nums2[n - 1] { - m -= 1; - nums1[m] - } else { - n -= 1; - nums2[n] - } - } - }; + let mut k = (m + n - 1) as usize; + let mut i = (m - 1) as isize; + let mut j = (n - 1) as isize; + + while j >= 0 { + if i >= 0 && nums1[i as usize] > nums2[j as usize] { + nums1[k] = nums1[i as usize]; + i -= 1; + } else { + nums1[k] = nums2[j as usize]; + j -= 1; + } + k -= 1; } } } diff --git a/solution/0000-0099/0088.Merge Sorted Array/Solution.rs b/solution/0000-0099/0088.Merge Sorted Array/Solution.rs index 91cf281490977..c249fdf88d637 100644 --- a/solution/0000-0099/0088.Merge Sorted Array/Solution.rs +++ b/solution/0000-0099/0088.Merge Sorted Array/Solution.rs @@ -1,26 +1,18 @@ impl Solution { pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { - let (mut m, mut n) = (m as usize, n as usize); - for i in (0..m + n).rev() { - nums1[i] = match (m == 0, n == 0) { - (true, false) => { - n -= 1; - nums2[n] - } - (false, true) => { - m -= 1; - nums1[m] - } - (_, _) => { - if nums1[m - 1] > nums2[n - 1] { - m -= 1; - nums1[m] - } else { - n -= 1; - nums2[n] - } - } - }; + let mut k = (m + n - 1) as usize; + let mut i = (m - 1) as isize; + let mut j = (n - 1) as isize; + + while j >= 0 { + if i >= 0 && nums1[i as usize] > nums2[j as usize] { + nums1[k] = nums1[i as usize]; + i -= 1; + } else { + nums1[k] = nums2[j as usize]; + j -= 1; + } + k -= 1; } } } diff --git a/solution/0000-0099/0088.Merge Sorted Array/Solution2.ts b/solution/0000-0099/0088.Merge Sorted Array/Solution2.ts deleted file mode 100644 index b39e6527d0dd5..0000000000000 --- a/solution/0000-0099/0088.Merge Sorted Array/Solution2.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - Do not return anything, modify nums1 in-place instead. - */ -function merge(nums1: number[], m: number, nums2: number[], n: number): void { - nums1.length = m; - nums2.length = n; - nums1.push(...nums2); - nums1.sort((a, b) => a - b); -} diff --git a/solution/0400-0499/0455.Assign Cookies/README_EN.md b/solution/0400-0499/0455.Assign Cookies/README_EN.md index 73ccf248e3e9f..c67de754267d9 100644 --- a/solution/0400-0499/0455.Assign Cookies/README_EN.md +++ b/solution/0400-0499/0455.Assign Cookies/README_EN.md @@ -59,7 +59,18 @@ You need to output 2. -### Solution 1 +### Solution 1: Sorting + Two Pointers + +According to the problem description, we should prioritize giving cookies to children with smaller appetites, so as to satisfy as many children as possible. + +Therefore, we first sort the two arrays, and then use two pointers $i$ and $j$ to point to the head of arrays $g$ and $s$ respectively. Each time we compare the size of $g[i]$ and $s[j]$: + +- If $s[j] < g[i]$, it means that the current cookie $s[j]$ cannot satisfy the current child $g[i]$. We should allocate a larger cookie to the current child, so $j$ should move to the right by one. If $j$ goes out of bounds, it means that the current child cannot be satisfied. At this time, the number of successfully allocated children is $i$, and we can return directly. +- If $s[j] \ge g[i]$, it means that the current cookie $s[j]$ can satisfy the current child $g[i]$. We allocate the current cookie to the current child, so both $i$ and $j$ should move to the right by one. + +If we have traversed the array $g$, it means that all children have been allocated cookies, and we can return the total number of children. + +The time complexity is $O(m \times \log m + n \times \log n)$, and the space complexity is $O(\log m + \log n)$. Where $m$ and $n$ are the lengths of arrays $g$ and $s$ respectively. diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README.md b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README.md new file mode 100644 index 0000000000000..91532df26b795 --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README.md @@ -0,0 +1,128 @@ +--- +comments: true +difficulty: 简单 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README.md +--- + + + +# [3173. Bitwise OR of Adjacent Elements 🔒](https://leetcode.cn/problems/bitwise-or-of-adjacent-elements) + +[English Version](/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README_EN.md) + +## 题目描述 + + + +

Given an array nums of length n, return an array answer of length n - 1 such that answer[i] = nums[i] | nums[i + 1] where | is the bitwise OR operation.

+ +

 

+

Example 1:

+ +
+

Input: nums = [1,3,7,15]

+ +

Output: [3,7,15]

+
+ +

Example 2:

+ +
+

Input: nums = [8,4,2]

+ +

Output: [12,6]

+
+ +

Example 3:

+ +
+

Input: nums = [5,4,9,11]

+ +

Output: [5,13,11]

+
+ +

 

+

Constraints:

+ +
    +
  • 2 <= nums.length <= 100
  • +
  • 0 <= nums[i] <= 100
  • +
+ + + +## 解法 + + + +### 方法一:遍历 + +我们遍历数组的前 $n - 1$ 个元素,对于每个元素,计算它和它的下一个元素的按位或值,将结果存入答案数组中。 + +时间复杂度 $O(n)$,其中 $n$ 是数组的长度。空间复杂度 $O(1)$。 + + + +#### Python3 + +```python +class Solution: + def orArray(self, nums: List[int]) -> List[int]: + return [a | b for a, b in pairwise(nums)] +``` + +#### Java + +```java +class Solution { + public int[] orArray(int[] nums) { + int n = nums.length; + int[] ans = new int[n - 1]; + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +} +``` + +#### C++ + +```cpp +class Solution { +public: + vector orArray(vector& nums) { + int n = nums.size(); + vector ans(n - 1); + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +}; +``` + +#### Go + +```go +func orArray(nums []int) (ans []int) { + for i, x := range nums[1:] { + ans = append(ans, x|nums[i]) + } + return +} +``` + +#### TypeScript + +```ts +function orArray(nums: number[]): number[] { + return nums.slice(0, -1).map((v, i) => v | nums[i + 1]); +} +``` + + + + + + diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README_EN.md b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README_EN.md new file mode 100644 index 0000000000000..47f67a39e49be --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/README_EN.md @@ -0,0 +1,128 @@ +--- +comments: true +difficulty: Easy +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README_EN.md +--- + + + +# [3173. Bitwise OR of Adjacent Elements 🔒](https://leetcode.com/problems/bitwise-or-of-adjacent-elements) + +[中文文档](/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README.md) + +## Description + + + +

Given an array nums of length n, return an array answer of length n - 1 such that answer[i] = nums[i] | nums[i + 1] where | is the bitwise OR operation.

+ +

 

+

Example 1:

+ +
+

Input: nums = [1,3,7,15]

+ +

Output: [3,7,15]

+
+ +

Example 2:

+ +
+

Input: nums = [8,4,2]

+ +

Output: [12,6]

+
+ +

Example 3:

+ +
+

Input: nums = [5,4,9,11]

+ +

Output: [5,13,11]

+
+ +

 

+

Constraints:

+ +
    +
  • 2 <= nums.length <= 100
  • +
  • 0 <= nums[i] <= 100
  • +
+ + + +## Solutions + + + +### Solution 1: Iteration + +We iterate through the first $n - 1$ elements of the array. For each element, we calculate the bitwise OR value of it and its next element, and store the result in the answer array. + +The time complexity is $O(n)$, where $n$ is the length of the array. The space complexity is $O(1)$. + + + +#### Python3 + +```python +class Solution: + def orArray(self, nums: List[int]) -> List[int]: + return [a | b for a, b in pairwise(nums)] +``` + +#### Java + +```java +class Solution { + public int[] orArray(int[] nums) { + int n = nums.length; + int[] ans = new int[n - 1]; + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +} +``` + +#### C++ + +```cpp +class Solution { +public: + vector orArray(vector& nums) { + int n = nums.size(); + vector ans(n - 1); + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +}; +``` + +#### Go + +```go +func orArray(nums []int) (ans []int) { + for i, x := range nums[1:] { + ans = append(ans, x|nums[i]) + } + return +} +``` + +#### TypeScript + +```ts +function orArray(nums: number[]): number[] { + return nums.slice(0, -1).map((v, i) => v | nums[i + 1]); +} +``` + + + + + + diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.cpp b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.cpp new file mode 100644 index 0000000000000..95b365458d454 --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.cpp @@ -0,0 +1,11 @@ +class Solution { +public: + vector orArray(vector& nums) { + int n = nums.size(); + vector ans(n - 1); + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +}; \ No newline at end of file diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.go b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.go new file mode 100644 index 0000000000000..b6d44bca4b185 --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.go @@ -0,0 +1,6 @@ +func orArray(nums []int) (ans []int) { + for i, x := range nums[1:] { + ans = append(ans, x|nums[i]) + } + return +} \ No newline at end of file diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.java b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.java new file mode 100644 index 0000000000000..a9fa9ede669ca --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.java @@ -0,0 +1,10 @@ +class Solution { + public int[] orArray(int[] nums) { + int n = nums.length; + int[] ans = new int[n - 1]; + for (int i = 0; i < n - 1; ++i) { + ans[i] = nums[i] | nums[i + 1]; + } + return ans; + } +} \ No newline at end of file diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.py b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.py new file mode 100644 index 0000000000000..1d4062e0ecf8a --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.py @@ -0,0 +1,3 @@ +class Solution: + def orArray(self, nums: List[int]) -> List[int]: + return [a | b for a, b in pairwise(nums)] diff --git a/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.ts b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.ts new file mode 100644 index 0000000000000..953d7161b2b0c --- /dev/null +++ b/solution/3100-3199/3173.Bitwise OR of Adjacent Elements/Solution.ts @@ -0,0 +1,3 @@ +function orArray(nums: number[]): number[] { + return nums.slice(0, -1).map((v, i) => v | nums[i + 1]); +} diff --git a/solution/README.md b/solution/README.md index 5c2ef9b98d2bc..ae8a6947a0966 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3183,6 +3183,7 @@ | 3170 | [删除星号以后字典序最小的字符串](/solution/3100-3199/3170.Lexicographically%20Minimum%20String%20After%20Removing%20Stars/README.md) | `栈`,`贪心`,`哈希表`,`字符串`,`堆(优先队列)` | 中等 | 第 400 场周赛 | | 3171 | [找到按位与最接近 K 的子数组](/solution/3100-3199/3171.Find%20Subarray%20With%20Bitwise%20AND%20Closest%20to%20K/README.md) | `位运算`,`线段树`,`数组`,`二分查找` | 困难 | 第 400 场周赛 | | 3172 | [第二天验证](/solution/3100-3199/3172.Second%20Day%20Verification/README.md) | `数据库` | 简单 | 🔒 | +| 3173 | [Bitwise OR of Adjacent Elements](/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README.md) | | 简单 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 0d36b708c8eb5..f489c0dd3793e 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3181,6 +3181,7 @@ Press Control + F(or Command + F on | 3170 | [Lexicographically Minimum String After Removing Stars](/solution/3100-3199/3170.Lexicographically%20Minimum%20String%20After%20Removing%20Stars/README_EN.md) | `Stack`,`Greedy`,`Hash Table`,`String`,`Heap (Priority Queue)` | Medium | Weekly Contest 400 | | 3171 | [Find Subarray With Bitwise AND Closest to K](/solution/3100-3199/3171.Find%20Subarray%20With%20Bitwise%20AND%20Closest%20to%20K/README_EN.md) | `Bit Manipulation`,`Segment Tree`,`Array`,`Binary Search` | Hard | Weekly Contest 400 | | 3172 | [Second Day Verification](/solution/3100-3199/3172.Second%20Day%20Verification/README_EN.md) | `Database` | Easy | 🔒 | +| 3173 | [Bitwise OR of Adjacent Elements](/solution/3100-3199/3173.Bitwise%20OR%20of%20Adjacent%20Elements/README_EN.md) | | Easy | 🔒 | ## Copyright