Question: Is coded in Java please and thank you! Input Parameters: sea: an array of integers 'indices : an array of integers (each of which may

 Is coded in Java please and thank you! Input Parameters: sea:

Is coded in Java please and thank you!

Input Parameters: sea: an array of integers 'indices : an array of integers (each of which may or may not be a valid index for ') Assumptions: sa may be empty. indices may be empty. 'indices may contain duplicates. * What to return? For each integer value in `indices", if it is a valid index for input array sa then use it to index into sea and include the result in the output array. For example: Say sea is {23, 46, 69} and `indices is {2, -1, 6, 3, 6, 2} (where indices -1 and 3 are invalid, so only indices 2, 0, 0, 2 are used) Then the method should return {69, 23, 23, 69} Note: Order of elements in the output array corresponds to the order in which valid indices in the 'indices array are arranged. That is, the output array may be empty if the input array sea is empty, or if the input array `indices does not contain any valid indices. See the JUnit tests related to this method. */ public static int[] task3(int[] seq, int[] indices) 1 int[] result = null; return result; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!