Menu

PWC 370 Scramble On, Scramblin' Man
📰
0

PWC 370 Scramble On, Scramblin' Man

DEV Community·Bob Lied·about 1 month ago
#l6AjyMXk
#pwc#perl#perlweeklychallenge#str2#str1#depth
Reading 0:00
15s threshold

If your girlfriend has been kidnapped by Gollum and the Evil One, and there's nothing you can do, perhaps console yourself with a small programming problem while you listen to Ramble On or Ramblin' Man' . PWC 370 Task 2: Scramble String The Task You are given two strings A and B of the same length. Write a script to return true if string B is a scramble of string A otherwise return false. String B is a scramble of string A if A can be transformed into B by a single (recursive) scramble operation. A scramble operation is: If the string consists of only one character, return the string. Divide the string X into two non-empty parts. Optionally, exchange the order of those parts. Optionally, scramble each of those parts. Concatenate the scrambled parts to return a single string.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More