fixes #502
This commit is contained in:
parent
99fb90e9f0
commit
90aa32338f
1 changed files with 2 additions and 3 deletions
|
@ -2,9 +2,9 @@ importance: 4
|
|||
|
||||
---
|
||||
|
||||
# Filter "in place"
|
||||
# Filter range "in place"
|
||||
|
||||
Write a function `filterRangeInPlace(arr, a, b)` that gets an array `arr` and removes from it all values except those that are between `a` and `b. The test is: `a ≤ arr[i] ≤ b`.
|
||||
Write a function `filterRangeInPlace(arr, a, b)` that gets an array `arr` and removes from it all values except those that are between `a` and `b. The test is: `a ≤ arr[i] ≤ b`.
|
||||
|
||||
The function should only modify the array. It should not return anything.
|
||||
|
||||
|
@ -16,4 +16,3 @@ filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
|
|||
|
||||
alert( arr ); // [3, 1]
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue