← ALL NOTES
Hash Table

3438. Find Valid Pair of Adjacent Digits in String

Given a digit string s. Return the first pair of adjacent distinct digits s[i]≠s[i+1] where each of the two digits' frequency in the whole string equals its value (digit d occurs exactly d times). If…

Loading…