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.
Your code should satisfy the following conditions:
pairElement("ATCGA")
shouldreturn [["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]]
pairElement("TTGAG")
shouldreturn [["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]]
. pairElement("CTCTA")
shouldreturn [["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]]
.
Try to establish your code using this function template:
Send link to your code in the comment section below. You can use any editor of your choice
Sammy
This is a link to my code
https://code.sololearn.com/WVrimQnw8Kqp