Problem: DNA-3, Finding Proteins

Problem Statement

Given a strand of DNA determine the number of nucleotides/base-pairs in the first protein reading from left-to-right (assume this is 5' to 3'). The beginning of a protein is signalled by the start codon ATG (not considered part of the protein) and the end of the protein is signalled by a stop codon, one of TAA, TAG, or TGA (also not part of the protein).

Your method should find the first protein (if there is one) and return the number of base-pairs in the protein. If the digital representation of the DNA is good, this number will be a multiple of three since there are three base-pairs per codon.

If there is no protein in the DNA, return -1.

Definition