You are given an array of barcodes where each element represents a barcode. Your task is to rearrange the barcodes such that no two adjacent barcodes are the same. It is guaranteed that a solution exists, and you may return any valid rearrangement.
You are given a list of unique product names and a search word. As each character of the search word is typed, you need to suggest up to three products that have a prefix matching the current search word. If there are more than three products with the same prefix, return the three lexicographically smallest products.
You are given a binary matrix where 1’s represent soldiers and 0’s represent civilians. The soldiers are positioned before the civilians in each row. A row is weaker than another if it has fewer soldiers, or if it has the same number of soldiers but appears earlier. Your task is to return the indices of the k weakest rows in the matrix, ordered from weakest to strongest.
You are given an integer array arr. You can choose a set of integers and remove all occurrences of these integers. Your task is to return the minimum size of the set such that at least half of the integers of the array are removed.
You are given a list of events where each event is represented by a pair [startDay, endDay]. Your task is to find the maximum number of events you can attend, ensuring that you attend only one event per day.
You are given three integers, a, b, and c, representing the maximum occurrences of ‘a’, ‘b’, and ‘c’ that can appear in a string. Your task is to return the longest string that can be formed using these letters such that it does not contain the substrings ‘aaa’, ‘bbb’, or ‘ccc’. The string should contain at most a occurrences of ‘a’, at most b occurrences of ‘b’, and at most c occurrences of ‘c’.