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

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

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

Post by answerhappygod »

Find The Digits Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shu 1
Find The Digits Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shu 1 (62.26 KiB) Viewed 55 times
Find The Digits Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shu 2
Find The Digits Problem Statement You Are Given Two Numbers X And Y Represented As Strings Y Is Generated By Random Shu 2 (57.23 KiB) Viewed 55 times
Find the Digits 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. ou 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 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.
Solution 1 #include <iostream> 2 #include <string> 3 #include <algorithm> 4 5 std::string findTheDigits (std::string x, std::string y) { // Write your code here return ""; 678 } Stdin Compiler Output Submission 1234 12345 I 0+ 0 Run Code Submit
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply