You are given an array of integers arr of even length n and an integer k. The task is to check if you can divide the array into exactly n / 2 pairs such that the sum of each pair is divisible by k. Return true if it’s possible to divide the array into valid pairs, otherwise return false.
You are given an array of integers nums and an integer target. Your task is to count how many non-empty subsequences of nums exist such that the sum of the minimum and maximum element in each subsequence is less than or equal to target. Return the result modulo 10^9 + 7.
You are given an array of integers. Your task is to determine if the array can be rearranged to form an arithmetic progression. The array can be rearranged in any order, and the common difference between consecutive elements should be the same.
You are given a wooden plank of length n, and some ants are walking on the plank. Some ants move to the left, others to the right. When two ants meet, they change directions without any additional time loss. When an ant reaches the edge of the plank, it falls off. The task is to determine when the last ant will fall off the plank.
You are given an array of positive integers. Compute all possible subarray sums, sort them in non-decreasing order, and return the sum of elements from index left to right in the sorted array modulo 10^9 + 7.