Skip to content

Instantly share code, notes, and snippets.

@riffAt2013
Last active February 23, 2018 14:32
Show Gist options
  • Save riffAt2013/b7252ec17d59eb08a18da30e45711805 to your computer and use it in GitHub Desktop.
Save riffAt2013/b7252ec17d59eb08a18da30e45711805 to your computer and use it in GitHub Desktop.
Method for Exercise 71 from Helsinki MOOC
public static void smartCombine(ArrayList<Integer> first, ArrayList<Integer> second)
{
int i = 0;
while (true)
{
if (first.contains(second.get(i)) == false)
first.add(second.get(i));
i++;
if (i== second.size()) break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment