To Marry or Not to Marry?
Landia country is strict about its marriage policy, allowing only couples with genes that are quite different to marry. To avoid diseases, the similarity of their genes should not exceed 80%. Doctors take samples and process them, i.e., convert the DNA sequences to amino acids. The sample can be corrupted; it must be checked if it was collected correctly: the DNA sequence can be converted to amino acids. A DNA sequence is correct if it only contains the 4 nucleotides (letters): A, G, T, and C. The sequence must begin with the Methionine (Met in the table) amino acid. Nucleotides can be converted to amino acids without residue and there must be only one stop signal in the sequence at the end of it. The DNA is transformed as follows: 3 nucleotides are converted to one amino acid according to the following table:
Determine how similar the chains of the two amino acids are. If they are similar in more than
80%, the program should output “
The similarity of two chains of amino acids means how many amino acids need to be replaced, deleted, or added to convert one into the other. That is, the similarity is the ratio of the number of steps to the length of the longer sequence, excluding the first and last amino acids:
The input contains two lines in varying lengths (between 0 and 120), the DNA sequences. The DNA sequences aren't necessarily the same length.
Print one line to the standard output, containing one of “
Sample Input 1
Output for Sample Input 1
Sample Input 2
Output for Sample Input 2
Sample Input 3
Output for Sample Input 3
|University of Debrecen; Faculty of Informatics; v. 03/01/2019|