All Posts

Leetcode 2895: Minimum Processing Time

You are given multiple processors with 4 cores each and tasks that need to be assigned to these processors. The goal is to compute the minimum time needed to complete all tasks, where the time taken by a processor is determined by the maximum completion time of its assigned tasks.

Leetcode 2900: Longest Unequal Adjacent Groups Subsequence I

You are given two arrays: words (a list of distinct strings) and groups (a binary array where each element corresponds to an entry in words). Your task is to select the longest alternating subsequence of words, where each consecutive word has a different corresponding group value. For each pair of consecutive words in the subsequence, the corresponding values in groups must be different.

Leetcode 2910: Minimum Number of Groups to Create a Valid Assignment

You are given a collection of balls, each marked with a number. Your task is to sort the balls into boxes in a way that follows two rules: Balls with the same number must be placed in the same box, but if there are multiple balls with the same number, they can be placed in different boxes. Additionally, the biggest box can only have one more ball than the smallest box. Return the fewest number of boxes required to sort these balls while following these rules.

Leetcode 2918: Minimum Equal Sum of Two Arrays After Replacing Zeros

You are given two arrays nums1 and nums2, both containing positive integers. Some elements in the arrays are zeros, which need to be replaced with strictly positive integers. The goal is to make the sums of both arrays equal by replacing the zeros in such a way that the resulting sums are the same. Return the minimum possible sum that can make the sums of both arrays equal, or return -1 if it is impossible.

Leetcode 2938: Separate Black and White Balls

You are given a binary string s of length n, where each character represents a ball: ‘1’ for black and ‘0’ for white. The goal is to arrange the balls such that all the white balls are on the left side and all the black balls are on the right side, by swapping two adjacent balls in each step. You need to find the minimum number of adjacent swaps required to achieve this arrangement.

Leetcode 2952: Minimum Number of Coins to be Added

You are given a list of coin denominations and a target value. Your task is to determine the minimum number of new coin denominations you need to add to the list, so that every integer value from 1 to the target can be formed as a sum of some subset of the coins. A coin denomination can be added if it helps form values that cannot be formed using the existing coins.