Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1521. Find a Value of a Mysterious Function Closest to Target
Given an array and a target, find the minimum absolute difference between target and the bitwise AND of any subarray arr[l..r]. The core challenge is to avoid O(n^2) checks by using the monotone/decreasing property of subarray ANDs (there are few distinct AND values ending at each index).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.