Input DNA: "CCAGGACCAGGCCCCAGGTGGGGCCAGGCCAGGCTC" ────────────────────────────────────────────────── Output RNA: "CCAGGACCAGGCCCCAGGUGGGGCCAGGCCAGGCUC"
You will learn about: strings.
DNA (deoxyribonucleic acid) is the molecule that carries the genetic information of all known living organisms (life on exoplanets might be totally different!). The genetic information is stored as a sequence of nucleotides of which there are four: adenine (A), cytosine (C), guanine (G), and thymine (T). So a DNA sequence can be stored on a computer as a string of ATCG characters.
Certain DNA sequences contain the information required to syntheize proteins, and the first step in the process is to transcribe the DNA sequence into a ribonucleic acid (RNA) sequence. The transcription process is biochemically complex, however the resulting RNA sequence is simple: it's equal to the DNA sequence with all instances of T replaced with a U (uracil).
Given the DNA string as input, return the transcribed RNA string. Keep in mind that these sequences can be very long (the human genome is 3,088,286,401 characters or base pairs long!).
Input: A string of ATCG characters representing a DNA sequence.
Output: The RNA sequence corresponding to the input DNA sequence.
|Maximum runtime||60 s||Max. memory usage||250 MiB|
Write a function that accepts the input as function parameters and returns the correct output. Make sure to read the description above to produce the correct output in the correct format and use the correct function signature so we can run your code. A good first step is to try reproducing the example(s). Your code must not take longer than the maximum runtime to run and must not use more memory than the allowed limit.
You must be logged in to view your submissions.
Let us know what you think about this problem! Was it too hard? Difficult to understand? Also feel free to discuss the problem, ask questions, and post cool stuff on Discourse. You should be able view the discussion thread below. Feel free to post your solutions but please do your best to organize and document your code well so others can learn from it.