Problem Description and Given Info
Write a public static method named inRange that will take an ArrayList<Integer>, and two
additional int values as arguments. This method will return an ArrayList<Integer>. When called, and
passed an ArrayList and a min value and a max value, this method will return an ArrayList containing all
the elements in the argument ArrayList that are between the second argument value and the third
argument value (inclusive) You can safely assume that the second argument value will always be less than or
equal to the third argument value The values in the returned ArrayList must be in the same order as they
are in the argument ArrayList.
Here are some examples:
Example 1
Given: ArrayList<Integer> myList = new ArrayList<Integer>(); with these values {1, 2,
3, 4, 5};
inRange(myList, 2, 4) should return an ArrayList<Integer> with these values {2, 3, 4}
Example 2
Given: ArrayList<Integer> myList = new ArrayList<Integer>(); with these values {3, 7,
6, 2, 9, 0, 4, 8};
inRange(myList, 3, 10) should return an ArrayList<Integer> with these values {3, 7, 6, 9,
4, 8}
Example 3
Given: ArrayList<Integer> myList = new ArrayList<Integer>(); with these values {1, 1,
1};
inRange(myList, 1, 1) should return an ArrayList<Integer> with these values {1, 1, 1}
Helpful Info: