You are given an encoded array of length n - 1, where each element encoded[i] represents the XOR of two consecutive elements in the original array arr, i.e., encoded[i] = arr[i] XOR arr[i + 1]. You are also given the first element of the original array arr[0]. Your task is to decode the array and return the original array arr.
You are given an array encoded of length n - 1, which represents the XOR of consecutive elements of a permutation of the first n integers. Your task is to decode the encoded array and return the original permutation perm of size n.
You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k. The value of coordinate (a, b) in the matrix is the XOR of all the values from matrix[0][0] to matrix[a][b] (inclusive), where 0 <= a < m and 0 <= b < n (0-indexed). Your task is to find the kth largest value (1-indexed) among all the XOR values of matrix coordinates.
A string is considered nice if every letter that appears in the string appears both in uppercase and lowercase. For example, ‘aA’ and ‘bB’ are nice strings, but ‘a’ and ‘B’ are not. Given a string s, find the longest nice substring of s. If there are multiple longest nice substrings, return the one that appears first. If no nice substring exists, return an empty string.
You are given a sorted array nums of non-negative integers and an integer maximumBit. For each query, you need to find the optimal integer k (less than 2^maximumBit) such that the XOR of all elements in the current nums array and k is maximized. Remove the last element from nums after each query and return an array of results.
You are given an array of integers nums. The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For every subset of nums, calculate the XOR total and return the sum of all XOR totals.