Tap here to switch tabs
Problem
Submissions

Problem: Largest Subarray Length K

med
30 min
Try to solve the Largest Subarray Length K problem.

Statement

An array A is said to be larger than an array B of the same length if, at the first index i where A[i] \neq B[i], the element A[i] is strictly greater than B[i].

Given an integer array nums composed of unique integers and an integer k, return the largest subarray of nums having a length of k.

Constraints:

  • 1≤k≤1 \leq k \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • All integers in nums are unique.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest Subarray Length K

med
30 min
Try to solve the Largest Subarray Length K problem.

Statement

An array A is said to be larger than an array B of the same length if, at the first index i where A[i] \neq B[i], the element A[i] is strictly greater than B[i].

Given an integer array nums composed of unique integers and an integer k, return the largest subarray of nums having a length of k.

Constraints:

  • 1≤k≤1 \leq k \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • All integers in nums are unique.