NatWest Group interview question

Find the duplicate characters in a string and explain different ways to solve it.