Cody

# Problem 2513. Genome decoding

Solution 1950115

Submitted on 26 Sep 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   Pass

2   Fail
genome = [ 228 24 40 36 167 231 71 248 107 9 32 140 245 234 217 233 0 124 202 239 161 247 204 255 173]; sequences = { 'GTCA' 'ACTA' 'ATTA' 'ATCA' 'TTCG' 'GTCG' 'CACG' 'GGTA' 'CTTG' 'AATC' 'ATAA' 'TAGA' 'GGCC' 'GTTT' 'GCTC' 'GTTC' 'AAAA' 'CGGA' 'GATT' 'GTGG' 'TTAC' 'GGCG' 'GAGA' 'GGGG' 'TTGC'}; assert(isequal(sequences, decode_genome(genome)));

l = 0 0 1 1 1 0 0 1 l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 c = "ACTG" l = 1 1 1 1 1 0 0 1 l = 0 1 1 1 1 1 1 0 l = 1 0 0 1 1 1 1 1 l = 1 1 1 0 0 1 1 1 c = "GCTG" l = 0 0 0 0 1 0 0 0 l = 0 0 0 0 0 0 1 0 l = 1 0 0 0 0 0 0 0 l = 0 0 1 0 0 0 0 0 c = "AATA" l = 0 1 1 1 1 0 1 0 l = 1 0 0 1 1 1 1 0 l = 1 0 1 0 0 1 1 1 l = 1 1 1 0 1 0 0 1 c = "CTTG" l = 0 1 1 0 1 0 0 0 l = 0 0 0 1 1 0 1 0 l = 1 0 0 0 0 1 1 0 l = 1 0 1 0 0 0 0 1 c = "CATT" l = 0 0 0 0 0 1 1 0 l = 1 0 0 0 0 0 0 1 l = 0 1 1 0 0 0 0 0 l = 0 0 0 1 1 0 0 0 c = "ATCA" l = 1 1 0 1 0 0 0 1 l = 0 1 1 1 0 1 0 0 l = 0 0 0 1 1 1 0 1 l = 0 1 0 0 0 1 1 1 c = "GCAC" l = 0 0 1 0 0 0 1 1 l = 1 1 0 0 1 0 0 0 l = 0 0 1 1 0 0 1 0 l = 1 0 0 0 1 1 0 0 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 0 1 0 0 1 l = 0 1 1 1 1 0 1 0 l = 1 0 0 1 1 1 1 0 l = 1 0 1 0 0 1 1 1 c = "GCTT" l = 0 1 0 0 0 0 1 0 l = 1 0 0 1 0 0 0 0 l = 0 0 1 0 0 1 0 0 l = 0 0 0 0 1 0 0 1 c = "CTAA" l = 0 1 1 1 0 1 1 0 l = 1 0 0 1 1 1 0 1 l = 0 1 1 0 0 1 1 1 l = 1 1 0 1 1 0 0 1 c = "CTCG" l = 1 1 1 1 1 0 1 1 l = 1 1 1 1 1 1 1 0 l = 1 0 1 1 1 1 1 1 l = 1 1 1 0 1 1 1 1 c = "GGTG" l = 0 1 1 0 1 0 1 1 l = 1 1 0 1 1 0 1 0 l = 1 0 1 1 0 1 1 0 l = 1 0 1 0 1 1 0 1 c = "CGTT"

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test2 (line 13) assert(isequal(sequences, decode_genome(genome)));

3   Fail
genome = [1 4 16 64; 234 186 174 171]; sequences = {'AAAC' 'AACA' 'ACAA' 'CAAA'; 'GTTT' 'TGTT' 'TTGT' 'TTTG'}; assert(isequal(sequences, decode_genome(genome)));

l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 c = "CAAA" l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 c = "TTTG" l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 c = "ACAA" l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 c = "TTGT" l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 l = 0 0 0 1 0 0 0 0 c = "AACA" l = 1 0 1 0 1 0 1 1 l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 c = "TGTT" l = 0 0 0 1 0 0 0 0 l = 0 0 0 0 0 1 0 0 l = 0 0 0 0 0 0 0 1 l = 0 1 0 0 0 0 0 0 c = "AAAC" l = 1 1 1 0 1 0 1 0 l = 1 0 1 1 1 0 1 0 l = 1 0 1 0 1 1 1 0 l = 1 0 1 0 1 0 1 1 c = "GTTT"

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test3 (line 3) assert(isequal(sequences, decode_genome(genome)));

4   Fail
genome = [228 225 216 210 198 201 180 177 156 147 135 141 108 99 120 114 78 75 39 45 27 30 54 57]'; sequences = {'GTCA' 'GTAC' 'GCTA' 'GCAT' 'GACT' 'GATC' 'TGCA' 'TGAC' 'TCGA' 'TCAG' 'TACG' 'TAGC' 'CTGA' 'CTAG' 'CGTA' 'CGAT' 'CAGT' 'CATG' 'ATCG' 'ATGC' 'ACTG' 'ACGT' 'AGCT' 'AGTC'}'; assert(isequal(sequences, decode_genome(genome)));

l = 0 0 1 1 1 0 0 1 l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 c = "ACTG" l = 0 1 1 1 1 0 0 0 l = 0 0 0 1 1 1 1 0 l = 1 0 0 0 0 1 1 1 l = 1 1 1 0 0 0 0 1 c = "CATG" l = 0 0 1 1 0 1 1 0 l = 1 0 0 0 1 1 0 1 l = 0 1 1 0 0 0 1 1 l = 1 1 0 1 1 0 0 0 c = "ATCG" l = 1 0 1 1 0 1 0 0 l = 0 0 1 0 1 1 0 1 l = 0 1 0 0 1 0 1 1 l = 1 1 0 1 0 0 1 0 c = "TACG" l = 1 0 1 1 0 0 0 1 l = 0 1 1 0 1 1 0 0 l = 0 0 0 1 1 0 1 1 l = 1 1 0 0 0 1 1 0 c = "TCAG" l = 0 1 1 1 0 0 1 0 l = 1 0 0 1 1 1 0 0 l = 0 0 1 0 0 1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0 1 1 c = "GTAC" l = 1 1 0 0 1 0 0 1 l = 0 1 1 1 0 0 1 0 l = 1 0 0 1 1 1 0 0 l = 0 0 1 0 0 1 1 1 c = "GCTA" l = 0 1 0 0 1 0 1 1 l = 1 1 0 1 0 0 1 0 l = 1 0 1 1 0 1 0 0 l = 0 0 1 0 1 1 0 1 c = "CGTA" l = 1 1 0 0 0 1 1 0 l = 1 0 1 1 0 0 0 1 l = 0 1 1 0 1 1 0 0 l = 0 0 0 1 1 0 1 1 c = "GTCA" l = 1 0 0 0 0 1 1 1 l = 1 1 1 0 0 0 0 1 l = 0 1 1 1 1 0 0 0 l = 0 0 0 1 1 1 1 0 c = "TGCA" l = 1 0 0 0 1 1 0 1 l = 0 1 1 0 0 0 1 1 l = 1 1 0 1 1 0 0 0 l = 0 0 1 1 0 1 1 0 c = "TCGA" l = 0 1 0 0 1 1 1 0 l = 1 0 0 1 0 0 1 1 l = 1 1 1 0 0 1 0 0 l = 0 0 1 1 1 0 0 1 c = "CTGA"

Output argument "sequences" (and maybe others) not assigned during call to "decode_genome". Error in Test4 (line 3) assert(isequal(sequences, decode_genome(genome)));

### Community Treasure Hunt

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

Start Hunting!