Finding a Motif

Advanced
Statement

Given two DNA strings *s* and *t*, return all locations of *t* as a substring of *s*. Use 1-based numbering.

Sample Input
GATATATGCATATACTT
ATAT
Sample Output
2 4 10
Constraints

Length of s <= 1k, length of t <= 1k

Check each starting position in the string s to see if it matches t.


My Notes
Log in to save personal notes.
Console output will appear here when you click Run Code or Submit...
Enter DNA / RNA / Protein test string
Next Problem
Counting Nucleotides