subject

Complete the isScrambled() function to return True if stringA can be reordered to make stringB. Otherwise, return False. Ignore spaces and capitalization. Note, you can not use a list or sort for this assignment.

Examples:
isScrambled( 'Easy', 'Yase' ) returns True
isScrambled( 'Easy', 'EasyEasy' ) returns False
isScrambled( 'eye', 'eyes' ) returns False
isScrambled( '', '' ) returns True
isScrambled( 'Game Test', 'tamegest' ) returns True

Hint:
One solution is to remove all spaces and make a lowercase version of each string. Then, compare the lengths to make sure that they're equal. Then, for each character in the first string, replace the first occurrence of it in the second string with an empty string. You can use the str method replace() to do this. Then, test that the second string is now an empty string.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 23.06.2019 00:10
My has been slow anyone else’s ?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
You know the right answer?
Complete the isScrambled() function to return True if stringA can be reordered to make stringB. Othe...
Questions
question
Mathematics, 25.06.2021 14:00
question
Health, 25.06.2021 14:00
question
English, 25.06.2021 14:00
question
Mathematics, 25.06.2021 14:00
Questions on the website: 13722363