Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1442. Count Triplets That Can Form Two Arrays of Equal XOR
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.
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.