You are given two strings, s and target. Your task is to determine the maximum number of times you can rearrange the characters of s to form the string target. A character from s can only be used once in the target string, and the letters must be rearranged to form a new target string each time.
You are given an integer array nums. In one operation, you can choose two integers in the array that are the same and remove both. The operation is repeated as many times as possible. Return an array where the first element is the number of pairs formed, and the second element is the number of leftover integers.
You are given an integer array ranks and a character array suits. These represent a set of 5 playing cards, where each card has a rank (from 1 to 13) and a suit (one of ‘a’, ‘b’, ‘c’, or ’d’). Determine the best possible poker hand you can make from the cards.
You are given a 0-indexed integer array, nums. A pair of indices (i, j) is considered a ‘bad pair’ if i < j and j - i is not equal to nums[j] - nums[i]. Your task is to determine the total number of bad pairs in the array.
You are given a string num consisting only of digits. Your task is to form the largest possible palindromic number by rearranging the digits of num. The resulting number should not have leading zeros and must use at least one digit from the string.