Skip to content

Instantly share code, notes, and snippets.

@minsooshin
Last active November 22, 2015 04:01
Show Gist options
  • Save minsooshin/9ca05282d68aae69e03f to your computer and use it in GitHub Desktop.
Save minsooshin/9ca05282d68aae69e03f to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/minsooshin 's solution for Bonfire: DNA Pairing
// Bonfire: DNA Pairing
// Author: @minsooshin
// Challenge: http://www.freecodecamp.com/challenges/bonfire-dna-pairing
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function pair(str) {
var pairing = {
"A": "T",
"T": "A",
"C": "G",
"G": "C"
},
final = [];
final = str.split('').map(function(val) {
var arr = [];
arr.push(val, pairing[val]);
return arr;
});
return final;
}
pair("GCG");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment