Cody

# Problem 519. Pig Latin to English Translator

Solution 1769981

Submitted on 2 Apr 2019 by Abdelfatah Teamah
• Size: 7
• This is the leading solution.
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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 5)]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)]

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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11)]

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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13)]

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In piglatin2english (line 2) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 15)]