Cody

# Problem 3019. Calculator spelling - Letters to Numbers

Solution 585026

Submitted on 19 Feb 2015 by James
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
%% n = 35007; word = 'LOOSE'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 35007 ans = 35007

2   Pass
%% n = 77345; word = 'ShELL'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 77345 ans = 77345

3   Pass
%% n = 36138; word = 'BEIgE'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 36138 ans = 36138

4   Pass
%% n = 378806; word = 'gOBBLE'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 378806 ans = 378806

5   Pass
%% n = 376006; word = 'gOOgLE'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 376006 ans = 376006

6   Pass
%% n = 57738461375; word = 'SLEIghBELLS'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 57738461375 ans = 5.7738e+10

7   Pass
%% n = 0.7734; word = 'hELLO'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 07734 ans = 0.7734 ans = 0.7734

8   Pass
%% n = 53045; word = 'ShOES'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 53045 ans = 53045

9   Pass
%% n = 771; word = 'ILL'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 771 ans = 771

10   Pass
%% n = 345; word = 'ShE'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 345 ans = 345

11   Pass
%% n = 7735; word = 'SELL'; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 7735 ans = 7735

12   Pass
%% ind = randi(4); n_arr = [36138 707 7714 57738]; n = n_arr(ind); word_arr = {'BEIgE','LOL','hILL','BELLS'}; word = word_arr{ind}; assert(isequal(calc_spell_num(word),n))

ans = 8 3 1 7 0 5 2 64 ans = 36138 ans = 36138

### Community Treasure Hunt

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

Start Hunting!