Recently I was asked a very tricky question in an interview.
Given an array like (just for example)
Now write an optimized algorithm (without using in build feature except the basic one like for loop etc.) so that the output does not contain duplicate values.
Please Note: Of course we can do it having 2 for loops, but its not optimized. They wanted an optimized solution.