Problem
A subsequence of a string is a collection of symbols contained in order (though not necessarily contiguously) in the string (e.g., ACG is a subsequence of TATGCTAAGATC). The indices of a subsequence are the positions in the string at which the symbols of the subsequence appear; thus, the indices of ACG in TATGCTAAGATC can be represented by (2, 5, 9).
As a substring can have multiple locations, a subsequence can have multiple collections of indices, and the same index can be reused in more than one appearance of the subsequence; for example, ACG is a subsequence of AACCGGTT in 8 different ways.
Given: Two DNA strings and (each of length at most 1 kbp) in FASTA format.
Return: One collection of indices of in which the symbols of appear as a subsequence of . If multiple solutions exist, you may return any one.
甲亚序列的字符串的是字符串中包含在顺序(尽管不一定连续)符号的集合(例如,ACG是T的子序列甲TG Ç TAA ģ ATC)。的索引的子序列的是该位置的字符串在其中的子序列的符号出现; 因此,TATGCTAAGATC中ACG的索引可以用(2,5,9)表示。
由于一个子串可以具有多个位置,一个子序列可以具有多个索引集合,并且同一索引可以在该子序列的多个外观中重复使用;例如,ACG是AACCGGTT的子序列,具有8种不同的方式。
给定:两个DNA串 ,(每个长度最多1 kbp)为FASTA格式。
返回值:一组索引,其中的符号 显示为的子序列。如果存在多个解决方案,则可以返回任何一个。
Sample Dataset
>Rosalind_14 ACGTACGTGACG >Rosalind_18 GTA
Sample Output
3 8 10