Menu

[Solved]Description Johnny Three Years Old Kids Likes Eat Sugar Oneday Sneak Kitchen Order Grab Su Q37160200

C programming question…Description Johnny is a three years old kids. He likes to eat sugar. Oneday, he sneak into the kitchen in order to grab someInput input contains two lines. First line is the string a Second line is the string b the length of the two string are the s

Description Johnny is a three years old kids. He likes to eat sugar. Oneday, he sneak into the kitchen in order to grab some sugar to eat. Unfortunately, his papa catch him. His papa call him:” Johnny, Johnny! Johnny reply: “Yes, papa.” papa then ask: ” Eating sugar?” Johnny lied: ” No, papa.” At that moment, Johnny begain to think that what’s defintion of string equivalent? In this three years old kids’ recognition, string a and string b is equivalent if a and b are the same or string a and string b can be devide into two same size part: a1, a2, b1, b2 and the following rules fulfill. For example: a papa ” bapap “, we need to check if ” pa” equals ” ap “in Johnny’ rule, therefore we divide” pa ” into “p” and “a”. Divide ” ap” into “a” and “p” Then because “p”–“p” && ” a “–“a” we know that “pa”–“ap”. therefore we can conclude that ” papa ” equals ” apap” Note that we can’t divide a string if the length of the string is an odd number. Help Johnny find out if the two string are the same. If you help him, he will give you some sugar. Input input contains two lines. First line is the string a Second line is the string b the length of the two string are the same and the length is from 1-105 ( 1 <-length <= 105 ) Output output contains one line. print “YES if two string is equal in Johnny’s rule, print “NO” otherwise remember to print In at the end of output Sample Input Download apapapap papapapa Sample Output YES Show transcribed image text Show transcribed image text Description Johnny is a three years old kids. He likes to eat sugar. Oneday, he sneak into the kitchen in order to grab some sugar to eat. Unfortunately, his papa catch him. His papa call him:” Johnny, Johnny! Johnny reply: “Yes, papa.” papa then ask: ” Eating sugar?” Johnny lied: ” No, papa.” At that moment, Johnny begain to think that what’s defintion of string equivalent? In this three years old kids’ recognition, string a and string b is equivalent if a and b are the same or string a and string b can be devide into two same size part: a1, a2, b1, b2 and the following rules fulfill. For example: a papa ” bapap “, we need to check if ” pa” equals ” ap “in Johnny’ rule, therefore we divide” pa ” into “p” and “a”. Divide ” ap” into “a” and “p” Then because “p”–“p” && ” a “–“a” we know that “pa”–“ap”. therefore we can conclude that ” papa ” equals ” apap” Note that we can’t divide a string if the length of the string is an odd number. Help Johnny find out if the two string are the same. If you help him, he will give you some sugar.
Input input contains two lines. First line is the string a Second line is the string b the length of the two string are the same and the length is from 1-105 ( 1

Expert Answer


Answer to Description Johnny is a three years old kids. He likes to eat sugar. Oneday, he sneak into the kitchen in order to grab … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *