[LeetCode] Count Triplets That Can Form Two Arrays of Equal XOR

1442. Count Triplets That Can Form Two Arrays of Equal XOR

Given an array of integers arr.

We want to select three indices i, j and k where (0 <= i < j <= k < arr.length).

Let’s define a and b 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 and k) Where a == b.

Read more
[LeetCode] Longest Subarray of 1`s After Deleting One Element

1493. Longest Subarray of 1’s After Deleting One Element

Given a binary array nums, you should delete one element from it.

Return the size of the longest non-empty subarray containing only 1’s in the resulting array. Return 0 if there is no such subarray.

Read more
[AtCoder] C - SentouRead more
[AtCoder] B - Choose IntegersRead more
[AtCoder] C - Big ArrayRead more
[AtCoder] D - Simple KnapsackRead more
[AtCoder] C - SequenceRead more
[Codeforces] Round #689 (Div. 2, based on Zed Code Competition) C. Random EventsRead more
[Codeforces] Round #690 (Div. 3) E1. Close Tuples (easy version)Read more
[Codeforces] Good Bye 2020 D. 13th Labour of HeraclesRead more