← Back to challenges

Transcribe to mRNA

JavaScriptHardalgorithmsconditionslanguage_fundamentalsstrings

Instructions

Transcribe the given DNA strand into corresponding mRNA - a type of RNA, that will be formed from DNA after transcription. DNA has the bases A, T, G and C, while RNA converts to U, A, C and G respectively.

Examples

dnaToRna("ATTAGCGCGATATACGCGTAC") ➞ "UAAUCGCGCUAUAUGCGCAUG"

dnaToRna("CGATATA") ➞ "GCUAUAU"

dnaToRna("GTCATACGACGTA") ➞ "CAGUAUGCUGCAU"

Notes

  • Transcription is the process of making complementary strand.
  • A, T, G and C in DNA converts to U, A, C and G respectively in mRNA.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Negative Image