Muhammad Ijaz wrote:Following is the hint on how to use Set and retainAll method to resolve your problem
Muhammad ,
Many of us couldn't control ourselves from sharing what we got or our knowledge, but giving code in that way is not a good way. At least let them try, let them come up with their own code/solutions.
seetharaman venkatasamy wrote:use merge sort .
Not exactly a merge sort, but while merging, just checked out the equality for the elements between two sorted halves and add the common element into a result/final list. [Looks like it get finally resulted as my first idea
]