You are given two strings containing only lowercase English…
You are given two strings containing only lowercase English letters. Write a function in C++ or using pseudocode that takes as input the two strings and returns a string containing the characters common to both strings in alphabetical order using a set or map data structure (unordered_set, unordered_map, set, or map). If a character is common to both strings more than once, then you must consider all occurrences of the repeated character separately. Note that you are not allowed to call the set_intersection method that is available in standard libraries. You MUST implement the intersection function yourself. Example 1:first string: “dabhieqiad”Second string: “bbxlwqyii”Output: “biiq”Example 2:First string: “amay”Second string: “patel”Output: “a”Example 3:First string: “tav”Second string: “miller”Output: “”
Read Details