Cody

# Problem 45387. Anagram

Solution 2174904

Submitted on 25 Mar 2020
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   Fail
assert(isequal(anagram("rail safety","fairy tales"),1))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test1 (line 1) assert(isequal(anagram("rail safety","fairy tales"),1))

2   Fail
assert(isequal(anagram("McDonald's restaurants","Uncle Sam's standard rot"),1))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test2 (line 1) assert(isequal(anagram("McDonald's restaurants","Uncle Sam's standard rot"),1))

3   Fail
assert(isequal(anagram("aaabbccd","abbccddd"),0))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test3 (line 1) assert(isequal(anagram("aaabbccd","abbccddd"),0))

4   Fail
assert(isequal(anagram("2343636","42343636"),0))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test4 (line 1) assert(isequal(anagram("2343636","42343636"),0))

5   Fail
assert(isequal(anagram("New York Times","Men's write coy"),0))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test5 (line 1) assert(isequal(anagram("New York Times","Men's write coy"),0))

6   Fail
assert(isequal(anagram("Justin Timberlake","I'm a jerk but listen"),1))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test6 (line 1) assert(isequal(anagram("Justin Timberlake","I'm a jerk but listen"),1))

7   Fail
assert(isequal(anagram("222233344441","122223334444"),1))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test7 (line 1) assert(isequal(anagram("222233344441","122223334444"),1))

8   Fail
assert(isequal(anagram("Tom Marvolo Riddle","I'm Lord Voldemort"),0))

The logical indices contain a true value outside of the array bounds. Error in anagram>@(x)sort(lower(x(isstrprop(x,'alphanum')))) (line 2) @(x)sort(lower(x(isstrprop(x,'alphanum')))); Error in anagram (line 3) isequal(ans(s),ans(t)); Error in Test8 (line 1) assert(isequal(anagram("Tom Marvolo Riddle","I'm Lord Voldemort"),0))