View on GitHub

marymafa.github.io


layout: post title: DNA pairing date: 2017-11-07 —

DNA pairing

This exercises was interesting, I did not spend much time on it and it was easier.

Instructions

We were supposse to return the provided character as the first element in each array for example input GCG and return [[“G”,”C”][“C”,”G”][“G”,”C”]]

Solution

I decide to create a variable called pair and str were it is going to split DNA strand. And also, includeded for loop were strand will iterated there. My testing statement is used to test DNA strand like if is A it should push pair and return “T”,”A” or if is T it should push pair and return “a”,”T”.
And if is G it will return “C,”G” or it will return “G”,”C” if is C. I consoled to see whether am i going to get an accurate result.

I have learned that it is simple to solve an exercise only if you understand the problem and you really know how are you going to solve it and it was not challenging.