You are given an array of integers nums and an integer key.
An integer target follows key if there is at least one index i such that nums.length nums[i] is equal to key, and nums[i + 1] is equal to target.
Return the integer target that appears the most times immediately after an occurrence of key.
Constraints:
nums.length
nums[i]
The test cases are generated such that the answer is unique.
You are given an array of integers nums and an integer key.
An integer target follows key if there is at least one index i such that nums.length nums[i] is equal to key, and nums[i + 1] is equal to target.
Return the integer target that appears the most times immediately after an occurrence of key.
Constraints:
nums.length
nums[i]
The test cases are generated such that the answer is unique.