##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Given DNA sequences (strings over the alphabet ), count the number of complementary pairs.
Two DNA sequences are complementary if they have the same length and at every position, the characters are complements: and .
For example, and are complementary. and are complementary.
A pair with is counted if sequence and sequence are complementary.
The complement of ACGT is TGCA (AT, CG, GC, TA). So (ACGT, TGCA) form a complementary pair. AAAA's complement is TTTT, which is not present. Answer: 1.