Cody

Solution 2068402

Submitted on 24 Dec 2019
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   Fail
B = '00001010101001101111011000001110001101101010011000000100111011100001011011110110000001001100111010101110110001101100011010100110101001100010011000000100000101101000011001101110101001100000010010110110111101101011011010100110011101100010111010101110101101100111010000000100001010100001011010100110000001001011011011110110010011101010011000000100001011100001011010100110100111100000010011001110101011101100011011000110101001101010011000100110001101000000010000101110000101101010011000000100101101101111011001001110101001100000010000101110000101101010011010011110000001001110111010000110011101100010111000000100001011101111011000000100110011101010111011000110110001101010011010100110001001100000010010000110011101100010011000000100001011100001011010100110000001001011011011110110010011101010011000000100001011100001011010100110100111100000010001100110100101100111011000100110000001001000011000000100111011101000011010011110000001000010111011110110000001001100111010101110110001101100011010100110101001100010011001110100000001001100101010010110101101101001011000110110100001100100111000110110100111100011010000000100111011100001011010100110011101100000010011001110111101101011011010100110111101100111011010100110000001001001011011001110000001000110011010000110100101100011011010010110011101101110011000110100000001000010111000010110101001100000010000101110101001100111011000100110101001100111011011000110100111100000010010010110110011100000010000101110111101100000010011100110101001100010111000000100111101100111011000000100100001100000010000100110111101101110111001110110111011101000011001001110001001100000010011001110000011101001011001001110100001100011011000000100001011100001011010000110001011100000010011000110100001100111011000000100101001100110111010100110011101100000010001000110101001101100011011110110101101101010011000000100100001100000010011001110101001100011011001100110101101000110011010101110001101100110011010010110001101100011011010010110011101101110011000000100000011100100111011110110000011100001011010100110110001101001111001110100'; y_correct = '50656F706C652077686F20737563636565642068617665206D6F6D656E74756D2E20546865206D6F7265207468657920737563636565642C20746865206D6F726520746865792077616E7420746F207375636365656420616E6420746865206D6F726520746865792066696E6420612077617920746F20737563636565642E2053696D696C61726C792C207768656E20736F6D656F6E65206973206661696C696E672C207468652074656E64656E637920697320746F20676574206F6E206120646F776E776172642073706972616C20746861742063616E206576656E206265636F6D6520612073656C662D66756C66696C6C696E672070726F70686563792E'; assert(isequal(bin2hex(B-48),y_correct))

Error using bin2dec (line 36) Input must be a character vector. Error in bin2hex (line 2) dec2hex(bin2dec(B)) Error in Test1 (line 3) assert(isequal(bin2hex(B-48),y_correct))

2   Fail
B = '011000101001011001001110110011100010111000110100000001000001011010000110011011101010011000000100100001100000010000100110101001100110011010010110011101101001011000101110101001100011010000000100110001100011011010100110100001100100111000000100000011100100111010000110110001100010111010010110110001101000011000110110000001001001011000100110101001101000011000110110110111000000010010000110000001001110011011110110100001100011011000110100000001001000011001110110000001001111011001000110010101101010011011000110001011101001011001101110101001100111010000000100110010101010011011000110111101100111011000100110001101000000010000010110100001100110111010100110000001000010111000010110101001100000010001110110101001101100011010100110110011101100111010000110010011101001111000000100101101101010011010000110011101101100111000000100001011101111011000000100100001101100011000010110100101101010011001101110101001100000010010011110111101101010111001001110000001001010011001110110001001101100111011011100000001001110111010010110110011100010011011110110101101100011010000000100101101101111011001110110101001101001111000110100000001001011011010000110001011101010011001001110100101101000011000110110110011100011010000000100100001100111011000100110000001001011011010100110001011100001011011110110001001101100111001110100'; y_correct = '46697273742C2068617665206120646566696E6974652C20636C6561722070726163746963616C20696465616C3B206120676F616C2C20616E206F626A6563746976652E205365636F6E642C206861766520746865206E6563657373617279206D65616E7320746F206163686965766520796F757220656E64733B20776973646F6D2C206D6F6E65792C206D6174657269616C732C20616E64206D6574686F64732E' assert(isequal(bin2hex(B-48),y_correct))

y_correct = '46697273742C2068617665206120646566696E6974652C20636C6561722070726163746963616C20696465616C3B206120676F616C2C20616E206F626A6563746976652E205365636F6E642C206861766520746865206E6563657373617279206D65616E7320746F206163686965766520796F757220656E64733B20776973646F6D2C206D6F6E65792C206D6174657269616C732C20616E64206D6574686F64732E'

Error using bin2dec (line 36) Input must be a character vector. Error in bin2hex (line 2) dec2hex(bin2dec(B)) Error in Test2 (line 3) assert(isequal(bin2hex(B-48),y_correct))

3   Fail
B = '100100100000010000100110111101100000010001110110111101100010111000000100110101100111011011110110111011100000010011101110000101101000011000101110000001001001001000000100101101101000011010011110000001001000011000001110000011101010011010000110010011100000010000101110111101100000010000101110000101101010011000000100111011101111011001001110001101100010011000110100000001000100011010101110001011100000010000101110111101100000010010110110100111101100111010100110001101100110011000000100100100100000010011001110101001101010011010110110000001000010111011110110000001000001011010000110011011101010011000000100010001101010011010100110011101100000010011110110011101100011011010011110000001000011011010010110110101101010011000000100100001100000010001000110111101101001111000000100000011100011011010000110100111101001011001110110111001100000010011110110011101100000010000101110000101101010011000000100110011101010011010000110110011100001011011110110010011101010011000110100000001001000011001110110001001100000010000100110100101100110111010100110010011100010111010010110011101101110011000000100101101101001111011001110101001100011011001100110000001001001011001110110000001000111011011110110111011100000010010000110011101100010011000000100001011100001011010100110011101100000010001100110100101100111011000100110100101100111011011100110000001001000011000000100110011101011011011110110111101100010111000010110101001100100111000000100000011101010011001000110010001100011011010100110000001001111011001001110000001001000011000000100000011100100111010100110001011100010111010010110101001100100111000000100110011100001011010100110001101100011011000000100001011100001011010000110011101100000010011110110010011100010011010010110011101101000011001001110100111100011010000000100111011100001011010010110001101101100111000101110000001000010111000010110101001100000010011100110010011101010011010000110001011100000010011110110110001101010011010000110011101100000010011110110011001100000010000101110010011101010111000101110000101100000010000110110100001101001111000000100100001100011011000110110000001001010111001110110001001101001011011001110110001101111011001101110101001100100111010100110001001100000010001000110101001100110011011110110010011101010011000000100101101101010011001110100'; y_correct = '4920646F206E6F74206B6E6F7720776861742049206D61792061707065617220746F2074686520776F726C642C2062757420746F206D7973656C662049207365656D20746F2068617665206265656E206F6E6C79206C696B65206120626F7920706C6179696E67206F6E207468652073656173686F72652C20616E6420646976657274696E67206D7973656C6620696E206E6F7720616E64207468656E2066696E64696E67206120736D6F6F7468657220706562626C65206F722061207072657474696572207368656C6C207468616E206F7264696E6172792C207768696C737420746865206772656174206F6365616E206F66207472757468206C617920616C6C20756E646973636F7665726564206265666F7265206D652E'; assert(isequal(bin2hex(B-48),y_correct))

Error using bin2dec (line 36) Input must be a character vector. Error in bin2hex (line 2) dec2hex(bin2dec(B)) Error in Test3 (line 3) assert(isequal(bin2hex(B-48),y_correct))

4   Fail
B = '1000001011001110000001001001001000000100110001101111011001110110110011101001011000100110101001100100111010100110001001100000010000101110000101101010011000000100101101101000011000101110001011101010011001001110000001001100011010000110010011101010011001100110101011100011011000110110100111100000010010010110001011100000010011100110010011101000011000100110101011101000011000110110001101101001111000000100110001101000011010110110101001100000010000101110111101100000010000110110100101101110011000010110001011100000010000101110000101101000011000101110000001001000011000110110001101100000010000101110000101101111011011001110101001100000010010110110100001100010111000101110101001100100111011001110000001001111011001110110001101101001111000000100111011101010011001001110101001100000010001001110101001100110011010100110010011100100111010100110001001100000010000101110111101100000010010110110100001100010111000010110101001101011011010000110001011101001011011000110110011100000010010010110011101100000010011101110000101101001011011000110000101100000010011110110010011100010011010100110010011100000010010000110011101100010011000000100101101101010011010000110110011101010111001001110101001101011011010100110011101100010111011001110000001001000011001001110101001100000010010010110011101100110111010100110110011100010111010010110111001101000011000101110101001100010011000110100000001001000011001110110001001100000010000101110000101101000011000101110000001001001011000101110000001001011011010000110110101101010011011001110000001000111011011110110000001000010011010010110011001100110011010100110010011101010011001110110110001101010011000000100111011100001011010100110001011100001011010100110010011100000010010010110001011100000010001000110101001100000010010010110011101100000010001110110101011101011011001000110101001100100111011001110001101000000010001100110100101101110011010101110010011101010011011001110001101000000010011001110001011101000011001001110110011100011010000000100110011101111011010101110011101100010011011001110000001001111011001001110000001001000011001110110100111100000010011110110001011100001011010100110010011100000010011110110010001100101011010100110110001100010111000000100001011100001011010000110001011100000010000101110000101101010011000000100100011101010111010100110110011100010111010010110111101100111011000000100111101100110011000000100101101101010011010000110110011101010111001001110101001101011011010100110011101100010111000000100100001100100111010010110110011101010011011001110011101000000010010010010000001001100111010000110111011100000010011000110111101100111011011001110101001101000111010101110101001100111011000101110001101101001111000000100001011100001011010000110001011100000010000101110000101101010011001001110101001100000010010110110101011101100111000101110000001000100011010100110000001001100111011110110101101101010011000000100111001101010011001110110101001100100111010000110001101100000010011001110110001101001011010100110011101101100011010100110000001000010111011110110000001001010011000011110000011100011011010000110100101100111011000000100001011100001011010000110001011100000010010100110001101101010011010110110101001100111011000101110000001001000011011001110000001001000011000000100111011100001011011110110001101101010011000000100111011100001011010010110110001100001011000000100111001101001011001101110101001101100111000000100010011101001011011001110101001100000010000101110111101100000010000001110010011101111011001000110001101101010011010110110110011100000010010000110010001101111011010101110001011100000010011110110010011100010011010100110010011100000010010000110011101100010011000000100101101101010011010000110110011101010111001001110101001101011011010100110011101100010111000110100000001000100111010100110110011100010111001001110100101101100011000101110101001100010011000000100100001101100111000000100001011100001011010100110110011101010011000000100100001100100111010100110000001000010111011110110000001000111011011110110000001001100111000001110101001101100011010010110100001100011011000000100110011101010111001000110010101101010011011000110001011100000010010110110100001100010111000101110101001100100111001110100000001000010101000010110100101101100111000110100000001001001001000000100000011101010011001001110110001101010011010010110011011101010011000100110000001001110111010000110110011100000010011000110100001100011011000110110101001100010011000000100010001001010111001110110100101100110111010100110010011101100111010000110001101100000010010110110100001100010111000010110101001101011011010000110001011101001011011000110110011100100010001110100'; y_correct = '4173204920636F6E7369646572656420746865206D6174746572206361726566756C6C79206974206772616475616C6C792063616D6520746F206C69676874207468617420616C6C2074686F7365206D617474657273206F6E6C79207765726520726566657272656420746F206D617468656D617469637320696E207768696368206F7264657220616E64206D6561737572656D656E74732061726520696E766573746967617465642C20616E642074686174206974206D616B6573206E6F20646966666572656E6365207768657468657220697420626520696E206E756D626572732C20666967757265732C2073746172732C20736F756E6473206F7220616E79206F74686572206F626A656374207468617420746865207175657374696F6E206F66206D6561737572656D656E74206172697365732E20492073617720636F6E73657175656E746C792074686174207468657265206D75737420626520736F6D652067656E6572616C20736369656E636520746F206578706C61696E207468617420656C656D656E7420617320612077686F6C65207768696368206769766573207269736520746F2070726F626C656D732061626F7574206F7264657220616E64206D6561737572656D656E742C20726573747269637465642061732074686573652061726520746F206E6F207370656369616C207375626A656374206D61747465722E20546869732C204920706572636569766564207761732063616C6C65642022756E6976657273616C206D617468656D6174696373222E'; assert(isequal(bin2hex(B-48),y_correct))

Error using bin2dec (line 36) Input must be a character vector. Error in bin2hex (line 2) dec2hex(bin2dec(B)) Error in Test4 (line 3) assert(isequal(bin2hex(B-48),y_correct))