You are given an integer array cards representing a sequence of cards.
Find the minimum number of consecutive cards you must pick up such that the selected sequence contains at least one pair of matching cards with the same value.
Return the minimum length of such a consecutive subarray. If it is impossible to find any matching pair, return
Constraints:
cards.length
cards[i]
You are given an integer array cards representing a sequence of cards.
Find the minimum number of consecutive cards you must pick up such that the selected sequence contains at least one pair of matching cards with the same value.
Return the minimum length of such a consecutive subarray. If it is impossible to find any matching pair, return
Constraints:
cards.length
cards[i]