Question: Task 2 Write a function solution that, given a string S consisting of N lowereare letters returns a string that only has letters that occur

Task 2
Write a function solution that, given a string S consisting of N lowereare letters returns a string that only has letters that occur once in the orisingl string, in the order that they appear on the original string.
Examples:
Given S= "codility", the function should return "codity".
Given S= "background" the function should retum "background.
Given S = "marmalade" the function should return "flde".
Given S= "peep" the function should return "(blank string).
Write an efficient algorithm for the following assumptions:
N is an integer within the range [1..300,000];
string S is made only of lowercase letters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!