You are given a 2D array ranges, where each entry ranges[i] = [starti, endi] denotes a range of integers between starti and endi (inclusive). You need to split the ranges into two groups, ensuring that overlapping ranges belong to the same group. Return the total number of ways to split the ranges into two groups modulo (10^9 + 7).
There are n people standing in a line labeled from 1 to n. The first person starts with a pillow. Every second, the person holding the pillow passes it to the next person in line. Once the pillow reaches the last person in the line, it starts moving back in the opposite direction, passing towards the first person. Given n and time, return the index of the person holding the pillow after time seconds.
You are given a 0-indexed array of strings words and two integers left and right. A string is considered a vowel string if it starts and ends with a vowel character (vowels are ‘a’, ’e’, ‘i’, ‘o’, ‘u’). Your task is to return the number of vowel strings in the array words where the indices fall within the range [left, right].
You are given a 0-indexed integer array nums. In one operation, you can choose two indices and subtract a power of two from both elements at those indices. A subarray is considered beautiful if you can make all of its elements equal to zero by applying the operation any number of times. Your task is to return the number of beautiful subarrays in nums.
You are given a 0-indexed integer array nums. In one operation, you can choose two indices and subtract a power of two from both elements at those indices. A subarray is considered beautiful if you can make all of its elements equal to zero by applying the operation any number of times. Your task is to return the number of beautiful subarrays in nums.
You are given an integer array nums. You can permute (rearrange) the elements of nums into a new array perm. Define the greatness of nums as the number of indices 0 <= i < nums.length where perm[i] > nums[i]. Your task is to return the maximum possible greatness you can achieve after permuting nums.