Cody

Problem 489. Bang Bang in Bangalore

Solution 3024061

Submitted on 1 Oct 2020 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
x = 'Bang bang bang!'; y = 'Bang-bang bang-bang bang-bang!'; assert(isequal(y,Bangalore(x)))

W = 1×3 cell array {'Bang '} {'bang '} {'bang!'} a = 1 6 11 b = 5 10 15 M = 1×4 cell array {0×0 char} {0×0 char} {0×0 char} {0×0 char} c = 1 6 11 d = 5 10 15 W = 1×3 cell array {'Bang '} {'bang '} {'bang!'} fr = 'Bang-bang ' fr = 'Bang-bang bang-bang ' fr = 'Bang-bang bang-bang bang-bang!'

2   Pass
x = 'Bang-bang bang-bang bang-bang!'; y = 'Bang bang bang!'; assert(isequal(y,Bangalore(x)))

W = 1×3 cell array {'Bang-bang '} {'bang-bang '} {'bang-bang!'} a = 1 11 21 b = 10 20 30 M = 1×4 cell array {0×0 char} {0×0 char} {0×0 char} {0×0 char} c = 1 11 21 d = 10 20 30 W = 1×3 cell array {'Bang-bang '} {'bang-bang '} {'bang-bang!'} fr = 'Bang ' fr = 'Bang bang ' fr = 'Bang bang bang!'

3   Pass
x = 'Bang-bang bang bang-bang bang bang bang-bang.'; y = 'Bang bang-bang bang bang-bang bang-bang bang.'; assert(isequal(y,Bangalore(x)))

W = 1×6 cell array {'Bang-bang '} {'bang '} {'bang-bang '} {'bang '} {'bang '} {'bang-bang.'} a = 1 11 16 26 31 36 b = 10 15 25 30 35 45 M = 1×7 cell array {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} {0×0 char} c = 1 11 16 26 31 36 d = 10 15 25 30 35 45 W = 1×6 cell array {'Bang-bang '} {'bang '} {'bang-bang '} {'bang '} {'bang '} {'bang-bang.'} fr = 'Bang ' fr = 'Bang bang-bang ' fr = 'Bang bang-bang bang ' fr = 'Bang bang-bang bang bang-bang ' fr = 'Bang bang-bang bang bang-bang bang-bang ' fr = 'Bang bang-bang bang bang-bang bang-bang bang.'

4   Pass
x = 'Nara3@# bangla bang purus%$# bang-bang swamy&^%$'; y = 'Nara3@# bangla bang-bang purus%$# bang swamy&^%$'; assert(isequal(y,Bangalore(x)))

W = 1×2 cell array {'bang '} {'bang-bang '} a = 16 30 b = 20 39 M = 1×3 cell array {'Nara3@# bangla '} {'purus%$# '} {'swamy&^%$'} c = 16 30 d = 20 39 W = 1×2 cell array {'bang '} {'bang-bang '} fr = 'Nara3@# bangla bang-bang purus%$# ' fr = 'Nara3@# bangla bang-bang purus%$# bang swamy&^%$'

5   Pass
x = 'Bang bang-bang upadhy3@# bang-bang swarg%$# bang-bang kumar&^%$'; y = 'Bang-bang bang upadhy3@# bang swarg%$# bang kumar&^%$'; assert(isequal(y,Bangalore(x)))

W = 1×4 cell array {'Bang '} {'bang-bang '} {'bang-bang '} {'bang-bang '} a = 1 6 26 45 b = 5 15 35 54 M = 1×5 cell array {0×0 char} {0×0 char} {'upadhy3@# '} {'swarg%$# '} {'kumar&^%$'} c = 1 6 26 45 d = 5 15 35 54 W = 1×4 cell array {'Bang '} {'bang-bang '} {'bang-bang '} {'bang-bang '} fr = 'Bang-bang ' fr = 'Bang-bang bang upadhy3@# ' fr = 'Bang-bang bang upadhy3@# bang swarg%$# ' fr = 'Bang-bang bang upadhy3@# bang swarg%$# bang kumar&^%$'

6   Pass
x = 'Bang-bang bangalore gyan&^%$ uttam$#@ bang.'; y = 'Bang bangalore gyan&^%$ uttam$#@ bang-bang.'; assert(isequal(y,Bangalore(x)))

W = 1×2 cell array {'Bang-bang '} {'bang.'} a = 1 39 b = 10 43 M = 1×3 cell array {0×0 char} {'bangalore gyan&^%$ uttam$#@ '} {0×0 char} c = 1 39 d = 10 43 W = 1×2 cell array {'Bang-bang '} {'bang.'} fr = 'Bang bangalore gyan&^%$ uttam$#@ ' fr = 'Bang bangalore gyan&^%$ uttam$#@ bang-bang.'

Suggested Problems

More from this Author100

Community Treasure Hunt

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

Start Hunting!