Available question text
Count the number of triplets (i, j, k) with 0 ≤ i < j ≤ k < n such that the XOR of arr[i..j-1] equals the XOR of arr[j..k]; this reduces to finding pairs of equal prefix-xor values because a == b iff prefixXOR[i] == prefixXOR[k+1], and each such pair contributes as many valid j positions as the gap between them.
Related questions
Continue with questions that share topics or the same question type.
- Count Paths That Can Form a Palindrome in a Tree
Coding · Bit Manipulation · Depth-First Search · Hash Table
- All Valid Triplets That Can Represent a Country
Coding
- Count Artifacts That Can Be Extracted
Coding
- Count Pairs in Two Arrays
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1442. Count Triplets That Can Form Two Arrays of Equal XOR
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source