Cody

Solution 734677

Submitted on 14 Sep 2015 by Alfonso Nieto-Castanon
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
%% assert(isequal(str2rgb('y'),[1 1 0]))

Awapwoatwn3djren50rvgaaaabjru5erkjggg=="}
2   Pass
%% assert(isequal(str2rgb('m'),[1 0 1]))

Qpaaafiuleqvr42u3vqqkaaaacmfux1hzcyanuc2kkao8iaqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gcqaobnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapizbad4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj+paicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnegdgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah6magb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfsqcanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapizcgd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gajcg2g06xopryh4aaaaasuvork5cyii="}
3   Pass
%% assert(isequal(str2rgb('c'),[0 1 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjkleqvr42u3vmq0aaazdspin3ahom1kygjxjwgb4qgiaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduakaaavwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxa0axa0axa0axa0axa0avwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxe0fafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0ajada1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0av1mbafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxa0axa0axa0axa0axa0avwmavwmavwmavwmacqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0axa0avwmavwoaqqo3ibpmqrbrjgaaaabjru5erkjggg=="}
4   Pass
%% assert(isequal(str2rgb('r'),[1 0 0]))

Iqa0raaaaaelftksuqmcc"}
5   Pass
%% assert(isequal(str2rgb('g'),[0 1 0]))

Aaaaaelftksuqmcc"}
6   Pass
%% assert(isequal(str2rgb('b'),[0 0 1]))

Qpaaafguleqvr42u3vqqkaaazespo3vek4cerbp60oapzjaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkasacanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzaegagj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqd4gqb+bgb+bgb+bgb+bocfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqbiaicfaycfaycfaycfaebnaobnaobnaobnapgzapgzapgzapgzah4gah4gah4gah4ggj8bgj8bgj8bgj8b4gca4gca4gca4gca+bka+bka+bka+bka+bkafgyafgyafgyafgaanwganwganwganwhgzwdgzwdgzwdgzwd4gqd4gqd4gqd4gqb+bgclhhm3nvtnmuknaaaaaelftksuqmcc"}
7   Pass
%% assert(isequal(str2rgb('w'),[1 1 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjuleqvr42u3vmq0aaazdspin3alym9kq8iqfgc8iaqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4maqcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagbwaguanaogdp84aaaaaelftksuqmcc"}
8   Pass
%% assert(isequal(str2rgb('k'),[0 0 0]))

Maax7cbw4aaaaasuvork5cyii="}
9   Pass
%% assert(isequal(str2rgb('yellow'),[1 1 0]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafjkleqvr42u3vmq0aaazdspin3ahom1kygjxjgwd4qqiaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduakaaavwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxa0axa0axa0axa0axa0avwmavwmavwmavwpa1qda1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxe0fafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0ajada1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbxawbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0avwmavwmavwmavwmavwpa1qda1qda1qda1qbwnqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1afwnafwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0av1mbafcdafcdafcdafcdwnuawnuawnuawnuawnuacduacduacduacduaxa0axa0axa0axa0axa0avwmavwmavwmavwmacqbwnqbwnqbwnqbwnqbcdqbcdqbcdqbcdqbcdqbxawbxawbxawbxa8dvamdvamdvamdvamdvaha1aha1aha1aha1aha1afwnafwnafwnafwnafcdafcdafcdafcdafcdwnuawnuawnuawnuacduacduacduacduacduaxa0axa0axa0axa0axa0avwmavwoarqpk6xpmvglgfwaaaabjru5erkjggg=="}
10   Pass
%% assert(isequal(str2rgb('magenta'),[1 0 1]))

Png;base64,ivborw0kggoaaaansuheugaaakcaaag1caiaaab8k8cvaaafkkleqvr42u3vmq0aaazdspin3ahom1kygjxjuwd4iria4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggkupaicraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4gosaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocrqqcaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqegdgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubocraycraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagc4ggc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaak4gak4gak4gak4gak4ggksbgksbgksbgksbgksb4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaq6kagksbgksbgksbgksb4goa4goa4goa4goa4goauboauboauboauboargyargyargyargyargaaqwgaqwgaqwgaqwhgahia4goa4goa4goa4goauboauboauboauboauboargyargyargyargaaqwgaqwgaqwgaqwgaqwhgagdgagdgagdgagdgagc4ggc4ggc4ggc4ggcubgcubgcubgcubgcubocraycraycraycraebqaobqaobqaobqaobqalgaalgaalgaalgaalgaak4gak4gafmhqq0tzjihwwkaaaaasuvork5cyii="}
11   Pass
%% assert(isequal(str2rgb('cyan'),[0 1 1]))

12   Pass
%% assert(isequal(str2rgb('red'),[1 0 0]))

13   Pass
%% assert(isequal(str2rgb('green'),[0 1 0]))

14   Pass
%% assert(isequal(str2rgb('blue'),[0 0 1]))

15   Pass
%% assert(isequal(str2rgb('white'),[1 1 1]))

16   Pass
%% assert(isequal(str2rgb('black'),[0 0 0]))

17   Pass
%% assert(isequal(str2rgb('y'),[1 1 0]))

18   Pass
%% assert(isequal(str2rgb('m'),[1 0 1]))

19   Pass
%% assert(isequal(str2rgb('c'),[0 1 1]))

20   Pass
%% assert(isequal(str2rgb('r'),[1 0 0]))

21   Pass
%% assert(isequal(str2rgb('g'),[0 1 0]))

22   Pass
%% assert(isequal(str2rgb('b'),[0 0 1]))

23   Pass
%% assert(isequal(str2rgb('w'),[1 1 1]))

24   Pass
%% str = 'adefhijlnopqstuvxz'; for ii=1:length(str) assert(isequal(str2rgb(str(ii)),[])) end

25   Pass
%% assert(isequal(str2rgb('cyanide'),[]))

26   Pass
%% assert(isequal(str2rgb('yellowfin tuna'),[]))

27   Pass
%% assert(isequal(str2rgb('blue jays'),[]))