Given an integer array nums of size n and a positive integer k, find all good indices in the array. An index i is considered good if: The k elements just before it are in non-increasing order, and the k elements just after it are in non-decreasing order. Return a list of all good indices in increasing order.
You are given a 0-indexed array nums of length n, where each element represents the number of items in a container. In one operation, you can pick an index i such that 1 <= i < n and nums[i] > 0, and move one item from nums[i] to nums[i-1]. Your goal is to minimize the maximum value in the array nums after performing any number of operations.
You are tasked with constructing binary strings using the characters ‘0’ and ‘1’. The string can be built by repeatedly appending ‘0’ zero times or ‘1’ one times, where ‘zero’ and ‘one’ are given values. The length of the final string must lie between ’low’ and ‘high’, inclusive. Your task is to find how many different binary strings can be created that meet these requirements. Return the count modulo 1e9 + 7.
You are given an integer array nums. A subsequence of nums is called a square streak if its length is at least 2, and after sorting the subsequence, each element (except the first one) is the square of the previous number. Return the length of the longest square streak in nums, or -1 if no square streak exists.
Given a string s consisting of digits between 1 and 9, and an integer k, you need to partition the string into the fewest possible substrings such that the value of each substring is less than or equal to k. Each substring must consist of contiguous digits and must be interpreted as an integer. If it’s not possible to partition the string in such a way, return -1.
You are given a binary matrix grid where you can move from any cell (row, col) to adjacent cells (row + 1, col) or (row, col + 1) only if they have the value 1. The grid is disconnected if there is no path from the top-left corner (0, 0) to the bottom-right corner (m - 1, n - 1). You are allowed to flip at most one cell (changing a 1 to 0 or vice versa), but you cannot flip the cells (0, 0) or (m - 1, n - 1). Return true if it is possible to disconnect the grid by flipping at most one cell, otherwise return false.