Given a DNA strand, return its RNA complement (per RNA transcription).
Both DNA and RNA strands are a sequence of nucleotides.
The four nucleotides found in DNA are adenine (A), cytosine (C), guanine (G) and thymine (T).
The four nucleotides found in RNA are adenine (A), cytosine (C), guanine (G) and uracil (U).
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:
- The input will always be either a string or an array/list of characters
- The output should always be either a string or an array/list of characters
- In the case of invalid input, you should output
'Invalid Input'as a string or an array/list of characters
- You can assume that you will only be given printable ASCII characters.
- This is code golf so the person with the least amount of bytes winsx
'C' -> 'G'
'A' -> 'U'
'ACGTGGTCTTAA' -> 'UGCACCAGAAUU'
'XXX' -> 'Invalid Input'
'ACGTXXXCTTAA' -> 'Invalid Input'
This task was taken from Exercism, which was founded by Katrina Owen and is licensed under the MIT License.