Alice and Bob are opponents in an archery competition. Alice first shoots numArrows arrows, followed by Bob, in the target scoring sections from 0 to 11. The goal is to maximize Bob’s total score, ensuring that the sum of arrows shot by Bob equals numArrows.
You are given an integer array cookies, where each element represents the number of cookies in a particular bag. You are also given an integer k, which denotes the number of children to distribute these bags of cookies to. Each bag must go to exactly one child, and cookies cannot be split between children. The unfairness of a distribution is defined as the maximum number of cookies any single child receives. Your goal is to return the minimum unfairness across all possible distributions.
You are given a string pattern consisting of the characters ‘I’ and ‘D’, where ‘I’ indicates that the next number in a sequence should be greater, and ‘D’ means the next number should be smaller. You need to construct the lexicographically smallest string num of length n + 1 such that the digits in num follow the conditions set by the pattern. The digits in num must be distinct and range from ‘1’ to ‘9’.
You are given a binary matrix matrix of size m x n and an integer numSelect. Your goal is to select exactly numSelect distinct columns from the matrix such that you cover as many rows as possible. A row is considered covered if all the 1’s in that row are included in the selected columns. If a row has no 1’s, it is also considered covered.
You are given an array of positive integers nums and a positive integer k. A subset of nums is considered beautiful if it does not contain any two integers whose absolute difference is equal to k. Your task is to return the number of non-empty beautiful subsets of the array nums. A subset is formed by deleting some (possibly none) elements from nums, and two subsets are different if their selected indices are different.
You are given an integer array representing the scores of students in an exam. Your task is to form a non-empty group of students such that the group’s strength, defined as the product of their scores, is maximized. The goal is to return the maximum possible strength that can be achieved by choosing an optimal group of students.