Cody

Problem 1755. Fix the last element of a cell array

Solution 2453163

Submitted on 2 Jun 2020 by Noriko HOUNOKI
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
A = {'MATLAB','HURRAY','SPARKLY','KITTENS','FUN'}; B = 'KITTENS'; C = {'MATLAB','HURRAY','SPARKLY','FUN','KITTENS'}; assert(isequal(puzzler(A,B),C))

tA = 4x2 table <strong>A</strong> <strong>ck</strong> <strong>_______</strong> <strong>_____</strong> MATLAB false HURRAY false SPARKLY false FUN false

2   Pass
A = {'HELP!','I''VE','FALLEN','ON THE','CAPS LOCK','KEY'}; B = 'stop shouting'; C = {'HELP!','I''VE','FALLEN','ON THE','CAPS LOCK','KEY'}; assert(isequal(puzzler(A,B),C))

tA = 6x2 table <strong>A</strong> <strong>ck</strong> <strong>_________</strong> <strong>_____</strong> HELP! false I'VE false FALLEN false ON THE false CAPS LOCK false KEY false

3   Pass
A = {'When','in the','human events','course','of'}; B = 'human events'; C = {'When','in the','course','of','human events'}; assert(isequal(puzzler(A,B),C))

tA = 4x2 table <strong>A</strong> <strong>ck</strong> <strong>______</strong> <strong>_____</strong> When false in the false course false of false

4   Pass
A = {'Soulwise','these','times','are','trying'}; B = 'times'; C = {'Soulwise','these','are','trying','times'}; assert(isequal(puzzler(A,B),C))

tA = 4x2 table <strong>A</strong> <strong>ck</strong> <strong>________</strong> <strong>_____</strong> Soulwise false these false are false trying false

Suggested Problems

More from this Author50

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!