Cody

Solution 1222800

Submitted on 30 Jun 2017 by Augusto Mazzei
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
str1 = 'estion-quay'; str2 = 'question'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 7 c = 8 par = 'estion' e = ' question' p = 1×0 empty char array e = 'question'

2   Pass
str1 = 'another-ay'; str2 = 'another'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 8 par = 'another' e = ' another' e = 'another'

3   Pass
str1 = 'ix-nay'; str2 = 'nix'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 3 c = 4 par = 'ix' e = ' nix' p = 1×0 empty char array e = 'nix'

4   Pass
str1 = 'another-ay one-ay ites-bay e-thay ust-day'; str2 = 'another one bites the dust'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 8 par = 'another' e = ' another' d = 5 par = 'one' e = ' another one' d = 6 c = 7 par = 'ites' e = ' another one bites' p = ' e-thay ust-day' d = 3 c = 4 par = 'e' e = ' another one bites the' p = ' ust-day' d = 5 c = 6 par = 'ust' e = ' another one bites the dust' p = 1×0 empty char array e = 'another one bites the dust'

5   Pass
str1 = 'ow-hay uch-may ood-way ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way'; str2 = 'how much wood would a woodchuck chuck if a woodchuck could chuck wood'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 3 c = 4 par = 'ow' e = ' how' p = ' uch-may ood-way ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 5 c = 6 par = 'uch' e = ' how much' p = ' ood-way ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 5 c = 6 par = 'ood' e = ' how much wood' p = ' ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 6 c = 7 par = 'ould' e = ' how much wood would' p = ' a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 3 par = 'a' e = ' how much wood would a' d = 10 c = 11 par = 'oodchuck' e = ' how much wood would a woodchuck' p = ' uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 5 c = 6 par = 'uck' e = ' how much wood would a woodchuck chuck' p = ' if-ay a-ay oodchuck-way ould-cay uck-chay ood-way' d = 4 par = 'if' e = ' how much wood would a woodchuck chuck if' d = 3 par = 'a' e = ' how much wood would a woodchuck chuck if a' d = 10 c = 11 par = 'oodchuck' e = ' how much wood would a woodchuck chuck if a woodchuck' p = ' ould-cay uck-chay ood-way' d = 6 c = 7 par = 'ould' e = ' how much wood would a woodchuck chuck if a woodchuck could' p = ' uck-chay ood-way' d = 5 c = 6 par = 'uck' e = ' how much wood would a woodchuck chuck if a woodchuck could chuck' p = ' ood-way' d = 5 c = 6 par = 'ood' e = ' how much wood would a woodchuck chuck if a woodchuck could chuck wood' p = 1×0 empty char array e = 'how much wood would a woodchuck chuck if a woodchuck could chuck wood'

6   Pass
str1 = 'eter-pay iper-pay icked-pay a-ay eck-pay of-ay ickle-pay eppers-pay'; str2 = 'peter piper picked a peck of pickle peppers'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 5 c = 6 par = 'eter' e = ' peter' p = ' iper-pay icked-pay a-ay eck-pay of-ay ickle-pay eppers-pay' d = 6 c = 7 par = 'iper' e = ' peter piper' p = ' icked-pay a-ay eck-pay of-ay ickle-pay eppers-pay' d = 7 c = 8 par = 'icked' e = ' peter piper picked' p = ' a-ay eck-pay of-ay ickle-pay eppers-pay' d = 3 par = 'a' e = ' peter piper picked a' d = 5 c = 6 par = 'eck' e = ' peter piper picked a peck' p = ' of-ay ickle-pay eppers-pay' d = 4 par = 'of' e = ' peter piper picked a peck of' d = 7 c = 8 par = 'ickle' e = ' peter piper picked a peck of pickle' p = ' eppers-pay' d = 8 c = 9 par = 'eppers' e = ' peter piper picked a peck of pickle peppers' p = 1×0 empty char array e = 'peter piper picked a peck of pickle peppers'

7   Pass
str1 = 'our-fay ore-scay'; str2 = 'four score'; str1_f = piglatin2english(str1); assert(strcmp(str1_f,str2))

d = 4 c = 5 par = 'our' e = ' four' p = ' ore-scay' d = 5 c = 6 par = 'ore' e = ' four score' p = 1×0 empty char array e = 'four score'