Company: IBM
Difficulty: medium
DNA/RNA Sequence Decoder Dioxyribonucleic Acid (DNA) and Ribonucleic Acid are long molecules forming the genetics and is copied over the generations. One of the components of DNA/RNA is a nucleotide which has nucleobases: Cytosine (C) Guanine (G) Adenine (A) Thymine (T) (Occurs in DNA only instead of Uracil (U)) Uracil (U) (Occurs in RNA only instead of Thymine (T)) Combination of these nucleobases form a DNA/RNA. Consider this table for solving the problem below: Nucleobase C G A T U Binary Value 001 010 011 101 110 Additionally, the sequence 000 is used to identify DNA and 111 identifies RNA. Given a sequence of binary integers of 3-bits each, you are expected to decode it in the readable format and also correct any errors in the input sequence. Example Input: 000001010111010100101110011 Now, the first 3 bits of the input are 000 which depicts that the remaining set of binary digits should be represented as a DNA sequence. Now, we group the remaining bits into sets of 3-bits which ca