String Trimmer
String Trimmer – A Fundamental Filtering Problem Problem Statement You are given T test cases. Each test case consists of two strings, A and B , comprised of lowercase English letters and separated by a space. Your task is to remove from string A all characters that are present in string B . The resulting string should preserve the original order of characters in A , excluding any characters that occur in B . Examples Input 2 data structures smart interviews Output srucures ineview Explanation In the first case, we remove all characters from "data structures" that appear in "smart" , resulting in "srucures" . In the second case, we remove characters from "interviews" that appear in "smart" , resulting in "ineview" . Best Data Structure for the Job To determine membership of a character in B efficiently, a HashSet is ideal. It provides constant-time average lookup and allows us to quickly veri...