Skip to content

Instantly share code, notes, and snippets.

@themonster2015
Created March 12, 2018 23:32
Show Gist options
  • Save themonster2015/27ee486dd5c977604db8e309b71e57c7 to your computer and use it in GitHub Desktop.
Save themonster2015/27ee486dd5c977604db8e309b71e57c7 to your computer and use it in GitHub Desktop.
DNA Pairing
The DNA strand is missing the pairing element. Take each character, get its pair, and return the results as a 2d array.
Base pairs are a pair of AT and CG. Match the missing element to the provided character.
Return the provided character as the first element in each array.
For example, for the input GCG, return [["G", "C"], ["C","G"],["G", "C"]]
The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment