Problem Statement You are given two numbers x and y represented as strings. y is generated by random shuffling x and the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem Statement You are given two numbers x and y represented as strings. y is generated by random shuffling x and the

Post by answerhappygod »

Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 1
Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 1 (68.69 KiB) Viewed 48 times
Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 2
Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 2 (68.69 KiB) Viewed 48 times
Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 3
Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shuffling X And The 3 (44.97 KiB) Viewed 48 times
Problem Statement You are given two numbers x and y represented as strings. y is generated by random shuffling x and then adding 0 to n more digits at any random positions. Create a function that takes in these two numbers (x and y) as string inputs and returns the newly inserted digit(s) that was/were added to y in the form of a concatenated string of all the newly added digit(s) in an ascending order. You must use a set or map data structure from STL to solve the problem. Note: A single digit can be added more than once in the new number. Constraints x and y > 0 0 < x.length, y.length <= 10^8 y.length x.length Example 1 Input: 8 56981234 Output: 1234569 Example 2 Input: 1234 12345 Output: 5 4 Explanation The sample input consists of two strings separated by a space and the sample output consists of the newly inserted digit(s) that was/were added to the shuffled first string in an ascending order. Problem Attributes
Solution 1 2 3 45678 #include <iostream> #include <string> #include <algorithm> std::string findTheDigits (std::string x, std::string y) { // Write your code here return ""; } Stdin Compiler Output 1234 12345 Submission
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply