Finding a Shared Motif (Longest Common Substring)

Intermediate Motif Multiple Sequences Longest Common Substring
Significance:
Conserved motifs shared across multiple sequences often indicate functionally or evolutionarily important regions — shared regulatory elements, conserved protein domains, or common ancestry. This is a simplified, single-answer version of the multiple sequence alignment problem that real comparative genomics tools solve at much larger scale.
Statement

Given a collection of DNA strings in FASTA format, find the **longest** substring common to **all** of them. If multiple longest common substrings of the same maximum length exist, any one of them is accepted.

Constraints

- `2 ≤ number of sequences ≤ 20`
- `1 ≤ length(each sequence) ≤ 500`
- The FASTA collection is guaranteed to share at least one common substring (at minimum, a single shared character)


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
RNA Splicing