2156. Find Substring With Given Hash Value
2156. Find Substring With Given Hash Value
Description
The hash of a 0-indexed string s
of length k
, given integers p
and m
, is computed using the following function:
30. Substring with Concatenation of All Words
30. Substring with Concatenation of All Words
Description
You are given a string s
and an array of strings words
. All the strings of words
are of the same length .
2269. Find the K-Beauty of a Number
2269. Find the K-Beauty of a Number
Description
The k-beauty of an integer num
is defined as the number of substrings of num
when it is read as a string that meet the following conditions:
1888. Minimum Number of Flips to Make the Binary String Alternating
1888. Minimum Number of Flips to Make the Binary String Alternating
Description
You are given a binary string s
. You are allowed to perform two types of operations on the string in any sequence:
2134. Minimum Swaps to Group All 1's Together II
2134. Minimum Swaps to Group All 1’s Together II
Description
A swap is defined as taking two distinct positions in an array and swapping the values in them.
2107. Number of Unique Flavors After Sharing K Candies
2107. Number of Unique Flavors After Sharing K Candies
Description
You are given a 0-indexed integer array candies
, where candies[i]
represents the flavor of the i^th
candy. Your mom wants you to share these candies with your little sister by giving her k
consecutive candies, but you want to keep as many flavors of candies as possible.
1151. Minimum Swaps to Group All 1's Together
1151. Minimum Swaps to Group All 1’s Together
Description
Given a binary array data
, return the minimum number of swaps required to group all 1
’s present in the array together in any place in the array.
1852. Distinct Numbers in Each Subarray
1852. Distinct Numbers in Each Subarray
Description
Given an integer array nums
and an integer k
, you are asked to construct the array ans
of size n-k+1
where ans[i]
is the number of distinct numbers in the subarray nums[i:i+k-1] = [nums[i], nums[i+1], ..., nums[i+k-1]]
.
1100. Find K-Length Substrings With No Repeated Characters
1100. Find K-Length Substrings With No Repeated Characters
Description
Given a string s
and an integer k
, return the number of substrings in s
of length k
with no repeated characters.