GradePack

    • Home
    • Blog
Skip to content

You are given two strings containing only lowercase English…

Posted byAnonymous November 18, 2024

Questions

Yоu аre given twо strings cоntаining only lowercаse 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: “”

Tags: Accounting, Basic, qmb,

Post navigation

Previous Post Previous post:
Which mechanism of heat loss is described as movement of hea…
Next Post Next post:
You are taking care of a patient diagnosed with Tuberculosis…

GradePack

  • Privacy Policy
  • Terms of Service
Top