Filter Values Above a Threshold (Set 2)

Easy

Given an array of integers nums and a limit, return the values that are strictly greater than limit, in their original order.

Filter Values Above a Threshold (Set 2) — the data. This set runs 4 cases: nums holds arrays of 11–19 items, with values from -28 to 60; limit ranges over -1–39. The hidden cases are the largest of the set.

Example 1

filterGreaterThan()
Input
nums = [14, 60, 29, -6, -27, -3, 12, -21, 34, -19, 60, 54], limit = 30
Output
[60, 34, 60, 54]

Why

`filterGreaterThan` returns `[60, 34, 60, 54]` for this input.

Example 2

filterGreaterThan()
Input
nums = [-6, 33, 3, -20, -9, -8, 11, 24, -27, -24, 5], limit = 39
Output
[]

Why

`filterGreaterThan` returns `[]` for this input.
Constraints
0 <= nums.length <= 10^5
-10^4 <= nums[i], limit <= 10^4
Every case in this set must pass: the first two are visible on Run, the last two unlock on Submit.

Topics

Arrays

Implement filterGreaterThan in the editor and return the answer — printing it is never graded.