You are tasked with processing a string of plates (’*’) and candles (’|’) arranged on a table. For a set of queries, you must determine the number of plates that are enclosed by candles within specified substrings of the string.
In a linked list, a critical point is defined as either a local maxima or a local minima. A local maxima is when a node’s value is strictly greater than both its previous and next node, while a local minima is when a node’s value is strictly smaller than both its previous and next node. Given a linked list, return an array containing the minimum and maximum distances between any two distinct critical points. If there are fewer than two critical points, return [-1, -1].
You are given a 0-indexed integer array nums, containing distinct numbers, an integer start, and an integer goal. There is an integer x, initially set to start, and you need to transform x into goal by repeatedly performing operations. You can use any number from the array nums in the following ways: x + nums[i], x - nums[i], or x ^ nums[i] (bitwise-XOR). You can perform each operation any number of times in any order. If the resulting number goes outside the range 0 <= x <= 1000, no further operations can be performed. The task is to determine the minimum number of operations required to convert x from start to goal, or return -1 if it is not possible.
You are given a string word consisting of lowercase English letters. Your task is to return the total sum of the number of vowels (‘a’, ’e’, ‘i’, ‘o’, and ‘u’) present in every possible substring of word. A substring is any contiguous sequence of characters in the word.
You are given a number n representing the number of retail stores and an array of integers quantities. Each quantity[i] represents the number of products of the i-th product type available. The task is to distribute all the products to the stores in such a way that no store gets more than one product type, but may receive any quantity of that type. The goal is to minimize the maximum number of products assigned to any store. Return the smallest possible value of this maximum number of products assigned to a store.