Cody

Solution 1923023

Submitted on 5 Sep 2019
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
words = {'uno', 'deux', 'tre'}; definitions = {'Spanish', 'French', 'Italian'}; d = createDictionary(words, definitions); order = [2 1 3]; assert(isequal(definitions(order), cellfun(d, words(order), 'UniformOutput', false)))

ans = Map with properties: Count: 3 KeyType: char ValueType: char

Output argument "d" (and maybe others) not assigned during call to "createDictionary". Error in Test1 (line 3) d = createDictionary(words, definitions);

2   Fail
words = {'CamelCase', 'camelCase', 'camel case', 'CAMELCASE'}; definitions = {'More properly MixedCase', 'Also known as nerdCaps', ... 'A dromedary valise', 'Why are you shouting?'}; d = createDictionary(words, definitions); order = [4 2 1 3]; assert(isequal(definitions(order), cellfun(d, words(order), 'UniformOutput', false)))

ans = Map with properties: Count: 4 KeyType: char ValueType: char

Output argument "d" (and maybe others) not assigned during call to "createDictionary". Error in Test2 (line 4) d = createDictionary(words, definitions);

3   Fail
words = {'J.R.R. Tolkien', 'George R.R. Martin', '#!', 'Ke$ha'}; definitions = {'LoTR', 'GoT', 'Shebang', 'Don''t ask'}; d = createDictionary(words, definitions); order = [4 1 3 2]; assert(isequal(definitions(order), cellfun(d, words(order), 'UniformOutput', false)))

ans = Map with properties: Count: 4 KeyType: char ValueType: char

Output argument "d" (and maybe others) not assigned during call to "createDictionary". Error in Test3 (line 3) d = createDictionary(words, definitions);

Suggested Problems

More from this Author1