Tap here to switch tabs
Problem
Submissions

Problem: Find the Largest Almost Missing Integer

Find the Largest Almost Missing Integer asks you to inspect an integer array and a subarray size, then return the largest value that appears in exactly one contiguous subarray of that size, or negative one if none qualifies.

Statement

You are given an integer array nums and an integer k.

An integer is considered almost missing if it appears in exactly 11 contiguous subarray of nums of size k.

Return the largest almost missing integer. If no such integer exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 0≤0 \leq nums[i] ≤50\leq 50

  • 1≤1 \leq k ≤\leq nums.length

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Largest Almost Missing Integer

Find the Largest Almost Missing Integer asks you to inspect an integer array and a subarray size, then return the largest value that appears in exactly one contiguous subarray of that size, or negative one if none qualifies.

Statement

You are given an integer array nums and an integer k.

An integer is considered almost missing if it appears in exactly 11 contiguous subarray of nums of size k.

Return the largest almost missing integer. If no such integer exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 0≤0 \leq nums[i] ≤50\leq 50

  • 1≤1 \leq k ≤\leq nums.length