Alice has a set of cards, each with a value written on it. She wants to rearrange these cards into groups, where each group consists of groupSize consecutive cards. Given an integer array hand where hand[i] represents the value on the ith card, and an integer groupSize, return true if she can rearrange the cards into groups of consecutive numbers, or false otherwise.
You are managing a lemonade stand where each lemonade costs $5. Customers are standing in line to buy one lemonade each, paying with either a $5, $10, or $20 bill. Your task is to determine if you can provide the correct change to every customer as they arrive in line. At the start, you have no change, and you must provide each customer with the appropriate change for their bill.
You are given a binary matrix where each row and column can be toggled independently. A toggle operation flips all values in a row or column (changing 0s to 1s and 1s to 0s). The matrix’s score is calculated by interpreting each row as a binary number and summing up these values. Your task is to determine the maximum score possible after performing any number of toggle operations.
Given two integer arrays nums1 and nums2 of the same length, the goal is to permute nums1 in a way that maximizes the number of indices i where nums1[i] > nums2[i]. Return any permutation of nums1 that achieves this.
You are given a list of people where each person has a certain weight, and a boat with a weight limit. Each boat can carry at most two people at the same time, as long as their combined weight does not exceed the boat’s weight limit. Your task is to determine the minimum number of boats required to rescue everyone.
You are given an integer array nums and an integer k. For each element in nums, you can either add or subtract k. The score of the array is calculated as the difference between the maximum and minimum elements of the modified array. Your task is to find and return the minimum possible score after modifying the values in the array.