Ad
  • Custom User Avatar

    This first if condition is not needed here. If arr1 is empty, arr1.size() returns 0 and the second if condition is never executed. If arr2 is empty, for each statement is not executed and outArray is returned as an empty collection anyway.