Categorygithub.com/szhou12/leetcode-goleetcode3171-Find-Subarray-With-Bitwise-OR-Closest-to-K
package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev

# README

3171. Find Subarray With Bitwise OR Closest to K

Solution idea

Binary Search + Bitwise OR 单调性 + Segment Tree

Time complexity = $O(n\cdot \log n \cdot \log n)$ where the first $\log n$ is for binary search, the second $\log n$ is for segment tree querying range.

Resrouce

【每日一题】LeetCode 3171. Find Subarray With Bitwise AND Closest to K