Inspired by this comic, you decided to do an experiment to see how people will react to pulling a lever that zaps them. In the study, if the participant decides not to pull the lever again, you put them in a set, and if they do it again, they don’t go in that set. But then your arch-nemesis comes and messes with your data by removing and adding people from your carefully determined set!
In order to save the study, we'll need your help: to purify the sets, write code to take in the mingled group of people and compute who will need to be added and removed to yield the original group.
Each person is represented as a single unique uppercase character A-Z, and a set of people is simply a string of uppercase characters in alphabetical order. The first set is the tarting set, and the second set is the ending set.
In order to save the study, we'll need your help: to purify the sets, write code to take in the mingled group of people and compute who will need to be added and removed to yield the original group.
Each person is represented as a single unique uppercase character A-Z, and a set of people is simply a string of uppercase characters in alphabetical order. The first set is the tarting set, and the second set is the ending set.
Input Format
Line 1: a string s representing the starting set Line 2: a string t representing the ending set Both strings will consist of unique uppercase characters in alphabetical order.
Sample Input
AEIOU
BCEISTU
Output Format Line 1: a string a representing the elements to be added Line 2: a string r representing the elements to be removed Both strings should consist of unique uppercase characters in alphabetical order. Print "NONE" if either set is empty.
Sample Output
BCST
AO
You must be logged in to submit a solution.