Intermediate Algorithm Scripting - DNA Pairing - I don't understand what I'm supposed to do

I know nothing about DNA, and I’m a high school dropout due to personal reasons (I’m considering earning an equivalent in my country). I suspect this is the reason why I don’t even understand what I’m supposed to do in this lesson.

The lesson states

Pairs of DNA strands consist of nucleobase pairs. Base pairs are represented by the characters AT and CG, which form building blocks of the DNA double helix.

The DNA strand is missing the pairing element. Write a function to match the missing base pairs for the provided DNA strand. For each character in the provided string, find the base pair character. Return the results as a 2d 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.

I don’t even understand what this means, nor do I even understand what I’m supposed to try to achieve. All other questions on this lesson I’ve seen in this forum seem to be from people who understand what they’re supposed to do, they just don’t know how. But I don’t even know what I’m supposed to do to begin with! Can someone please guide me in the right direction and fill the required gaps in my knowledge of DNA?

Thanks in advance!

If you’ve made it this far, the good news is that you understand JavaScript enough to solve this. Don’t panic! You’ve got this!

Basically, in DNA there are four chemicals. These chemicals are represented by the letters ATCG. It was quickly mentioned but perhaps not well enough, but the letter A can only ever be matched to T, and the letter C can only ever be matched to G.

It’s asking you to write a program to check each letter, then match the pair together (if the letter is G, its match will be C). Store the original letter and its matched letter in an array. Then store all those little arrays in one big array as the final answer.
Does that make sense?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.