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, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 24.06.2019 11:20
William travels a lot on business purpose. he needs to regularly communicate with his business partner. he also needs to send out weekly reports to his boss while he is traveling. which web-based application best suits william’s needs? (social media, webmail, wiki) is the best web-based application for william. he can access this application via the internet using a (digital cable, fax machine, web browser).
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
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
Health, 22.08.2021 06:50
question
Mathematics, 22.08.2021 06:50
question
History, 22.08.2021 06:50
Questions on the website: 13722360