Maximum Consecutive Good Numbers

Arrays Contest Easy Go Ad-Free - ₹20/mo

Given an array of integers nums and an array goodNumbers, return the maximum number of consecutive good numbers in the array.


Any number present in the goodNumbers array is a good number.

Constraints

  • 1 <= nums.length <= 105
  • 1 <= goodNumbers.length <= 105
  • -104 <= nums[i], goodNumbers[i] <= 104

Company Tags

[ ]