insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Remove duplicate characters from a string.

Remove duplicate characters from a string.

Difficulty: Hard

Phase: 5 · Strings

XP Reward: 30 XP

Topics: Strings, Hard

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Remove duplicate characters from a string so each appears only once, preserving first occurrence. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: banana

Output: ban

Explanation: Sample execution for input banana