Cody

Solution 1563001

Submitted on 18 Jun 2018 by Srishti Saha
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
expect_bin=randi(2,1,10)-1; str=char(9*expect_bin+79); binvec=str2Binvec(str); assert(isequal(expect_bin,binvec))

test_b = '1O11O1111O' test_b = '1011011110' ans = 1 0 1 1 0 1 1 1 1 0

2   Pass
expect_bin=randi(2,1,5)-1; str=char(9*expect_bin+79); binvec=str2Binvec(str); assert(isequal(expect_bin,binvec))

test_b = '1O111' test_b = '10111' ans = 1 0 1 1 1

3   Pass
expect_bin=randi(2,1,25)-1; str=char(9*expect_bin+79); binvec=str2Binvec(str); assert(isequal(expect_bin,binvec))

test_b = '1OOOO1O1111111OO1O1OOO1OO' test_b = '1000010111111100101000100' ans = 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0