All Posts

Leetcode 2735: Collecting Chocolates

You are given an array nums where each element represents the cost of collecting a chocolate of a specific type. You can perform an operation to change the types of chocolates, and each operation incurs a cost. Your task is to determine the minimum total cost to collect all types of chocolates.

Leetcode 2740: Find the Value of the Partition

You are given a list of positive integers nums. Your task is to partition this list into two non-empty arrays, nums1 and nums2, such that the absolute difference between the maximum element of nums1 and the minimum element of nums2 is minimized.

Leetcode 2741: Special Permutations

You are given a list of distinct positive integers nums. A permutation of nums is considered special if, for every pair of consecutive numbers in the permutation, one number is divisible by the other. Your task is to return the total number of special permutations of nums, modulo 10^9 + 7.

Leetcode 2744: Find Maximum Number of String Pairs

You are given a list of distinct strings words, where each string consists of exactly two lowercase English letters. You are tasked with finding the maximum number of pairs of strings that can be formed where one string is the reverse of the other.

Leetcode 2746: Decremental String Concatenation

You are given an array of distinct strings. Your task is to perform n-1 join operations optimally to minimize the length of the final string.

Leetcode 2747: Count Zero Request Servers

Given a list of server requests and multiple queries specifying time intervals, determine the number of servers that did not receive any requests during each query’s time interval.