Cody

# Problem 2513. Genome decoding

Solution 1950122

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 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 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 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 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 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 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 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 l = 0 0 0 0 0 0 0 0 l = 0 0 0 0 0 0 0 0 l = 0 0 0 0 0 0 0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 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 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 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 sequences = 1×4 cell array {0×0 double} {0×0 double} {0×0 double} {'TTGC'}

Assertion failed.

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 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 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 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 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 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 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 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 sequences = 1×4 cell array {0×0 double} {0×0 double} {0×0 double} {'TTTG'}

Assertion failed.

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 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 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 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 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 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 l = 1 1 0 0 1 0 0 1 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 l = 1 0 1 1 0 1 0 0 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 l = 1 0 1 1 0 0 0 1 l = 0 0 1 0 0 1 1 1 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 = 1 1 1 0 0 1 0 0 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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 l = 1 1 1 0 0 1 0 0 l = 0 0 1 1 1 0 0 1 sequences = 1×4 cell array {0×0 double} {0×0 double} {0×0 double} {'AGTC'}

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!