Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer.
To solve this problem, we can apply the same approach as we used to check the unique character in the string. Please check for the unique character in the string for better understanding of below given solution.
Using one Boolean array:
Using only one extra variable: