We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally posted by mah-shamim August 9, 2024 Given an array of integers arr.
arr
We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).
i
j
k
(0 <= i < j <= k < arr.length)
Let's define a and b as follows:
a
b
a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]
b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]
Note that ^ denotes the bitwise-xor operation.
Return the number of triplets (i, j and k) Where a == b.
a == b
Example 1:
Example 2:
Constraints:
1 <= arr.length <= 300
1 <= arr[i] <= 108
The text was updated successfully, but these errors were encountered:
When branches are created from issues, their pull requests are automatically linked.
Discussed in #275
Originally posted by mah-shamim August 9, 2024
Given an array of integers
arr
.We want to select three indices
i
,j
andk
where(0 <= i < j <= k < arr.length)
.Let's define
a
andb
as follows:a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]
b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]
Note that ^ denotes the bitwise-xor operation.
Return the number of triplets (
i
,j
andk
) Wherea == b
.Example 1:
Example 2:
Constraints:
1 <= arr.length <= 300
1 <= arr[i] <= 108
The text was updated successfully, but these errors were encountered: