Given two strings string1 and string2, remove those characters from first string(string1) which are present in second string(string2). Both the strings are different and contain only lowercase characters. NOTE: Size of first string is always greater than the size of second string( |string1| > |string2|).
string1 = "computer"
string2 = "cat"
Explanation: After removing characters(c, a, t)
from string1 we get "ompuer".
string1 = "occurrence"
string2 = "car"
Explanation: After removing characters
(c, a, r) from string1 we get "ouene".
You dont need to read input or print anything. Complete the function removeChars()which takes string1 and string2 as input parameter and returns the result string after removing characters from string2 from string1.
Expected Time Complexity:O( |String1| + |String2| ) Expected Auxiliary Space: O(K),Where K = Constant