Viruses are usually bad for your health. How about fighting them with... other viruses? In
this problem, you need to find out how to synthesize such good viruses.
We have prepared for you a set of strings of the letters A, G, T and C. They correspond to the
DNA nucleotide sequences of viruses that we want to svnthesize, using the following operations:
* Adding a nucleotide either to the beginning or the end of the existing sequence
* Replicating the sequence, reversing the copied piece, and gluing it either to the beginmng or
to the end of the original (so that e.g., AGTC can become AGTCCTGA or CTGAAGTC).
We're concerned about efficiency, since we have very many such sequences, some of them verv
long. Find a wav to svnthesize them in a mmimum number of operations.
你要用ATGC四个字母用两种操作拼出给定的串:
1.将其中一个字符放在已有串开头或者结尾
2.将已有串复制,然后reverse,再接在已有串的头部或者尾部
一开始已有串为空。求最少操作次数。
len<=100000