Hi,
I'm having problems with week 3 exercise 71.
I've created the function smartCombine() and it seems to work well with all the types of data that is given to it. Still one test case fails which says :
Combination of lists [5,1,2] and [40] should contain the number 40.
But when I put in these values to the lists, the output as expected is [5,1,2,40].
Still the test case fails..
My code snippet is:
public static void smartCombine(ArrayList<Integer> first, ArrayList<Integer> second) {
int i = 0;
while (i < min(first.size(), second.size())) {
// the min() function returns the minimum size of the lists.
if (!first.contains(second.get(i))) {
first.add(second.get(i));
continue;
}
i++;
}
Please help!
Best regards,
Ashutosh Tripathi