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.
You are given a 0-indexed integer array nums and a positive integer value. In one operation, you can either add or subtract the integer value from any element of the array nums. The MEX (Minimum Excluded Value) of an array is the smallest non-negative integer that does not appear in the array. Your task is to determine the maximum possible MEX of the array nums after performing the mentioned operations any number of times.
You are given a bag with items, where each item has a number written on it, which could be 1, 0, or -1. You are also given the counts of items with 1s, 0s, and -1s, as well as a positive integer k. Your task is to pick exactly k items from the bag, maximizing the sum of the numbers written on the selected items.
You are given a 0-indexed integer array nums of length n. You can perform the following operation as many times as needed: pick an index i that has not been previously selected, and choose a prime number p such that p < nums[i]. Then, subtract p from nums[i]. Your task is to determine if it is possible to make the array strictly increasing by performing the operation described.
You have two mice and a set of n different types of cheese. Each type of cheese has a different point value when eaten by either mouse. The first mouse must eat exactly k types of cheese, while the second mouse eats the remaining cheese types. Your task is to maximize the total points the two mice can achieve by distributing the cheese types between the mice.
You are given a 0-indexed integer array nums and an integer p. Your task is to find p pairs of indices such that the maximum absolute difference between any of the pairs is minimized. Each index can be used in at most one pair. Return the minimized value of the maximum difference among all the pairs.