IN DNA, A pair with T,G with C and vice-versa.
So, if input is "GCG"
you have to return an array [[“G”,“C”],[“C”,“G”],[“G”,“C”]]
To do it
Take a single character of the given string
and match it using any loop and if or switch case etc.
eg:-
for (loop until the given string length)
{
Take each character and check
If (this)
then
{this}
If (this)
then
{this}
}
U can use switch in place of if …then
plus there are other ways to do it.
Try it first …if not will help with more.