Question: Inputs: (char) The corrupted message (char) The string used to fix the message Outputs: 1. (char) The fixed message Background: Every friend group has the
Inputs:
-
(char) The corrupted message
-
(char) The string used to fix the message
Outputs:
1. (char) The fixed message
Background:
Every friend group has the one friend who owns an Android phone and sends green texts in the group chat. One day, that friend sent a text that got corrupted so that some letters in the message were replaced by question marks, and in an attempt to redeem themselves, they sent a second text with seemingly random letters. Replacing the question marks in the first text with the corresponding letters from the second text is the only way to fix the text and understand what the friend wanted to say.
Function Description:
Given two character vectors, replace all the question marks in the first string with the corresponding letters from the second string.
Example:
str1 = 'And id is ?ct?a?ly ?uper?or!' str2 = 'htu mngth aojuelioxsokdeioro' fixedStr = corruptedMessage(str1, str2) fixedStr 'Android is actually superior!'
passed [98, 43] numPass 2
Notes:
The two strings are guaranteed to be the same length.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
