Question
DNA Sequences
The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When studying DNA, it is useful to identify repeated sequences within the DNA. Given a string s that represents a DNA sequence, return all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. You should return the answer in lexicographically sorted order.
Input
User Task
As this is a functional problem, Your task here is to complete the function findRepeatedDnaSequences, which takes a string s as it's functional parameters.
Custom Input
The first line of the input contains a single string str, representing the DNA sequence.
As this is a functional problem, Your task here is to complete the function findRepeatedDnaSequences, which takes a string s as it's functional parameters.
Custom Input
The first line of the input contains a single string str, representing the DNA sequence.
Output
Return all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule in lexicographically sorted order.
Example
Sample Input
AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT
Sample Output
AAAAACCCCC
CCCCCAAAAA
Explanation
AAAAACCCCC, CCCCCAAAAA are the 2 only sequences which occur more than 1 times in the DNA Sequence, other than these 2 no other string exists.
AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT
Sample Output
AAAAACCCCC
CCCCCAAAAA
Explanation
AAAAACCCCC, CCCCCAAAAA are the 2 only sequences which occur more than 1 times in the DNA Sequence, other than these 2 no other string exists.