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, 21.06.2019 21:30
What is linux? an open source operating system a version of ms dos the first version of unix the newest technology available
Answers: 1
question
Computers and Technology, 22.06.2019 05:00
Are special characters that allow you to search for multiple words at the same time.
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
What did i do wrong with this const discord = require('discord.js'); var bot = new discord.client(); const token = 'ntm3mjcxmtu1mjg3ote2ntq2.dyogew.dpfiwfpuifzuzvifop-csuxasnm' const prefix = "! " bot.registry.registergroup('simple', 'simple'); bot.registry.registerdefaults(); bot.registry. + '/commands'); bot.on('message', message => { if(message.content == 'hi! ') { message.channel.send ('@everyone sup, how is @everyone day going'); } if(message.content == 'h3lp') { message.channel.send ('dose not have any commands yet'); } bot.on('ready', function() { console.log("ready") }); bot.login(token);
Answers: 1
You know the right answer?
Complete the isScrambled() function to return True if stringA can be reordered to make stringB. Othe...
Questions
question
Social Studies, 29.08.2021 21:00
question
History, 29.08.2021 21:00
Questions on the website: 13722363