Filter Greater Than
EasyData EngineeringArraySorting
Description
Given an array and a threshold, return only the values strictly greater than the threshold, preserving order.
Examples
Input:
[1,5,3,8,2], 3Output:
[5,8]Explanation:
Every value at or below the threshold is dropped and the rest stay in their original order.
Input:
[1,2,3], 5Output:
[]Explanation:
Every value at or below the threshold is dropped and the rest stay in their original order.
Input:
[10,20,30], 0Output:
[10,20,30]Explanation:
Every value at or below the threshold is dropped and the rest stay in their original order.
Constraints
- •
0 ≤ length ≤ 10⁴