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:
AmazonMicrosoftSamsungAdobeTCS + 1 more
Topics:
StringStack
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.