Dipanjan, use available data structures, put it in a Map<Char, Integer>, get the stream of that and use a lambda to get at a Collection<Char> with the condition that the Integer in that Map would be > 1, something like that. Or use loops. But definitely use a Map<Char, Integer>.

Then, loop through the char array of that String and make another Map<Char, List<Integer>> and add to that list when you encounter that char...

You will end up with a Map that has a Char key and a List of its locations with the String you're parsing.