Skip to content

Instantly share code, notes, and snippets.

@MonikaMahanthappa
Last active April 24, 2019 01:35
Show Gist options
  • Save MonikaMahanthappa/51735977bb64f4978dc7fc80436489e8 to your computer and use it in GitHub Desktop.
Save MonikaMahanthappa/51735977bb64f4978dc7fc80436489e8 to your computer and use it in GitHub Desktop.
RNA and DNA Transcription

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:

G -> C
C -> G
T -> A
A -> U

Similarly, Given a RNA strand, its transcribed DNA strand is formed by replacing each nucleotide with its complement:

C -> G
G -> C
A -> T
U -> A

Technical needs

You are expected to deliver a jar that supports above mentioned functionality, with the following interface:

$ java -jar transcription.jar

Sample Input:

RNA UGCACCAGAAUU
DNA ACGTGGTCTTAA

Output:

DNA ACGTGGTCTTAA
RNA UGCACCAGAAUU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment