1803. Count Pairs With XOR in a Range
https://leetcode.com/problems/count-pairs-with-xor-in-a-range
Description
Given a (0-indexed) integer array nums
and two integers low
and high
, return the number of nice pairs.
A nice pair is a pair (i, j)
where 0 <= i < j < nums.length
and low <= (nums[i] XOR nums[j]) <= high
.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 2 * 104
1 <= nums[i] <= 2 * 104
1 <= low <= high <= 2 * 104
ac
Previous1802. Maximum Value at a Given Index in a Bounded ArrayNext1804. Implement Trie II (solutions/Prefix Tree)
Last updated