You are given a 0-indexed integer array ’nums’. A subarray of ’nums’ is called continuous if the absolute difference between any two elements in the subarray is less than or equal to 2. Return the total number of continuous subarrays.
You are given an array ’nums’ consisting of positive integers. A subarray is called complete if the number of distinct elements in the subarray is equal to the number of distinct elements in the entire array. Return the total number of complete subarrays.
You are given a list of integers nums and an integer k. Your task is to find the length of the longest subarray where all the elements are equal after you delete at most k elements.
You are given an integer array nums and two positive integers m and k. Return the maximum sum out of all almost unique subarrays of length k in nums. A subarray is almost unique if it contains at least m distinct elements. If no such subarray exists, return 0.
You are given an array nums and an integer target. The array infinite_nums is created by infinitely appending nums to itself. You need to find the length of the shortest contiguous subarray in infinite_nums whose sum equals the target. If no such subarray exists, return -1.
You are given a binary string s and a positive integer k. A substring of s is considered ‘beautiful’ if it contains exactly k occurrences of ‘1’. Your task is to return the lexicographically smallest substring of the shortest length that has exactly k ‘1’s. If no such substring exists, return an empty string.