2415 Count The Number Of Ideal Arrays
Count the Number of Ideal Arrays You are given two integers n and maxValue, which are used to describe an ideal array. A 0-indexed integer array arr of length n is considered ideal if the follow...
Count the Number of Ideal Arrays You are given two integers n and maxValue, which are used to describe an ideal array. A 0-indexed integer array arr of length n is considered ideal if the follow...
Count the Hidden Sequences You are given a 0-indexed array of n integers differences, which describes the differences **between each pair of **consecutive **integers of a **hidden sequence of len...
Rabbits in Forest There is a forest with an unknown number of rabbits. We asked n rabbits “How many rabbits have the same color as you?” and collected the answers in an integer array answers wher...
Rabbits in Forest There is a forest with an unknown number of rabbits. We asked n rabbits “How many rabbits have the same color as you?” and collected the answers in an integer array answers wher...
Count the Number of Fair Pairs Given a 0-indexed integer array nums of size n and two integers lower and upper, return the number of fair pairs. A pair (i, j) is **fair **if: 0 <= i < j &...
Count and Say The count-and-say sequence is a sequence of digit strings defined by the recursive formula: countAndSay(1) = "1" countAndSay(n) is the run-length encoding of countAndSay(n - 1). ...
Count Equal and Divisible Pairs in an Array Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) where 0 <= i < j < n, such that nums[i] == ...
Count the Number of Good Subarrays Given an integer array nums and an integer k, return the number of good subarrays of nums. A subarray arr is good if there are **at least **k pairs of indices ...
Count Good Triplets in an Array You are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, …, n - 1]. A good triplet is a set of 3 distinct values w...
Count Good Triplets Given an array of integers arr, and three integers a, b and c. You need to find the number of good triplets. A triplet (arr[i], arr[j], arr[k]) is good if the following condi...