3471. Find the Largest Almost Missing Integer
You are given an integer array
nums
and an integerk
.An integer
x
is almost missing fromnums
ifx
appears in exactly one subarray of sizek
withinnums
.Return the largest almost missing integer from
nums
. If no such integer exists, return-1
.A subarray is a contiguous sequence of elements within an array.
c++
1 | class Solution { |