Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Remove Duplicates From A String

Difficulty: Easy

Acceptance: 61.68%

Points: 20.00

Given a string **str** that may contain both lowercase and uppercase letters, your task is to remove all duplicate characters from **str** while preserving the order of their first occurrence.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(N)

Expected Space Complexity: O(N)

Constraints:
  • 1 <= N <= 10^5
  • String contains uppercase and lowercase English letters.
Companies:
Amazon Microsoft Samsung Adobe TCS + 1 more
Topics:
String Stack
Locked Content
Access Restricted: Please Login to access the code editor and test cases.