Cody

Problem 89. Counting in Finnish

Solution 2615530

Submitted on 26 Jun 2020 by 春樹 内糸
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 = [1 2 3 4 5 6 7 8 9 0]; b = [8 2 3 6 4 0 7 5 9 1]; out = finnishOrdering(a); assert(isequal(out, b));

fin = 1×10 string array "nolla" "yksi" "kaksi" "kolme" "nelja" "viisi" "kuusi" "seitseman" "kahdeksan" "yhdeksan" ns = 0 1 2 3 4 5 6 7 8 9 fina = 1×10 string array "yksi" "kaksi" "kolme" "nelja" "viisi" "kuusi" "seitseman" "kahdeksan" "yhdeksan" "nolla" sn = 1×10 string array "kahdeksan" "kaksi" "kolme" "kuusi" "nelja" "nolla" "seitseman" "viisi" "yhdeksan" "yksi" idx = 8 2 3 6 4 10 7 5 9 1 b = 1 2 3 4 5 6 7 8 9 10 b = 8 2 3 4 5 6 7 8 9 10 b = 8 2 3 4 5 6 7 8 9 10 b = 8 2 3 4 5 6 7 8 9 10 b = 8 2 3 6 5 6 7 8 9 10 b = 8 2 3 6 4 6 7 8 9 10 b = 8 2 3 6 4 0 7 8 9 10 b = 8 2 3 6 4 0 7 8 9 10 b = 8 2 3 6 4 0 7 5 9 10 b = 8 2 3 6 4 0 7 5 9 10 b = 8 2 3 6 4 0 7 5 9 1

2   Pass
a = [1 1 1 2 0 4 5 3 7 2 9 8 9]; b = [8 2 2 3 4 0 7 5 9 9 1 1 1]; out = finnishOrdering(a); assert(isequal(out, b));

fin = 1×10 string array "nolla" "yksi" "kaksi" "kolme" "nelja" "viisi" "kuusi" "seitseman" "kahdeksan" "yhdeksan" ns = 0 1 2 3 4 5 6 7 8 9 fina = 1×13 string array "yksi" "yksi" "yksi" "kaksi" "nolla" "nelja" "viisi" "kolme" "seitseman" "kaksi" "yhdeksan" "kahdeksan" "yhdeksan" sn = 1×13 string array "kahdeksan" "kaksi" "kaksi" "kolme" "nelja" "nolla" "seitseman" "viisi" "yhdeksan" "yhdeksan" "yksi" "yksi" "yksi" idx = 12 4 10 8 6 5 9 7 11 13 1 2 3 b = 1 2 3 4 5 6 7 8 9 10 11 12 13 b = 8 2 3 4 5 6 7 8 9 10 11 12 13 b = 8 2 3 4 5 6 7 8 9 10 11 12 13 b = 8 2 2 4 5 6 7 8 9 10 11 12 13 b = 8 2 2 3 5 6 7 8 9 10 11 12 13 b = 8 2 2 3 4 6 7 8 9 10 11 12 13 b = 8 2 2 3 4 0 7 8 9 10 11 12 13 b = 8 2 2 3 4 0 7 8 9 10 11 12 13 b = 8 2 2 3 4 0 7 5 9 10 11 12 13 b = 8 2 2 3 4 0 7 5 9 10 11 12 13 b = 8 2 2 3 4 0 7 5 9 9 11 12 13 b = 8 2 2 3 4 0 7 5 9 9 1 12 13 b = 8 2 2 3 4 0 7 5 9 9 1 1 13 b = 8 2 2 3 4 0 7 5 9 9 1 1 1

3   Pass
a = [0 0 0 1 5 4 3 2 7 5 9]; b = [2 3 4 0 0 0 7 5 5 9 1]; out = finnishOrdering(a); assert(isequal(out, b));

fin = 1×10 string array "nolla" "yksi" "kaksi" "kolme" "nelja" "viisi" "kuusi" "seitseman" "kahdeksan" "yhdeksan" ns = 0 1 2 3 4 5 6 7 8 9 fina = 1×11 string array "nolla" "nolla" "nolla" "yksi" "viisi" "nelja" "kolme" "kaksi" "seitseman" "viisi" "yhdeksan" sn = 1×11 string array "kaksi" "kolme" "nelja" "nolla" "nolla" "nolla" "seitseman" "viisi" "viisi" "yhdeksan" "yksi" idx = 8 7 6 1 2 3 9 5 10 11 4 b = 1 2 3 4 5 6 7 8 9 10 11 b = 2 2 3 4 5 6 7 8 9 10 11 b = 2 3 3 4 5 6 7 8 9 10 11 b = 2 3 4 4 5 6 7 8 9 10 11 b = 2 3 4 0 5 6 7 8 9 10 11 b = 2 3 4 0 0 6 7 8 9 10 11 b = 2 3 4 0 0 0 7 8 9 10 11 b = 2 3 4 0 0 0 7 8 9 10 11 b = 2 3 4 0 0 0 7 5 9 10 11 b = 2 3 4 0 0 0 7 5 5 10 11 b = 2 3 4 0 0 0 7 5 5 9 11 b = 2 3 4 0 0 0 7 5 5 9 1

Suggested Problems

More from this Author95

Community Treasure Hunt

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

Start Hunting!