You are given an array of positive integers arr and an array of queries. For each query [lefti, righti], calculate the XOR of elements from index lefti to righti (inclusive). Return an array answer where each element corresponds to the XOR result of the respective query.
You are given three positive integers, a, b, and c. Your task is to find the minimum number of bit flips required in a and b to make the result of (a OR b) equal to c. A bit flip consists of changing any bit from 0 to 1 or from 1 to 0.
You are given an array of integers. Sort the array based on the number of 1’s in the binary representation of each integer. If two integers have the same number of 1’s, sort them in ascending order of the integer value.
A cinema has multiple rows, each with ten seats arranged in a line. Some seats are already reserved. You need to determine the maximum number of four-person groups that can be seated in the available seats. A four-person group requires four adjacent seats in one row. If an aisle splits a group in the middle, they can still be seated if there are two consecutive seats on both sides of the aisle.
You are given a binary string representing a non-negative integer. The task is to determine the number of steps required to reduce this number to 1, following the rules: divide by 2 if the number is even, or add 1 if it is odd. Return the total number of steps required.