DNA Genetic Marker Shortest Common Sequence
DNA Genetic Marker Shortest Common Sequence
HardArrays100% accepted
A Mumbai genetics laboratory analyzes COVID variant genomes from patient samples. Find the shortest DNA sequence present across all patient samples—this genetic marker could unlock treatment protocols. Rule: return the LENGTH of the longest contiguous substring present in every sample (0 if none). Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Find the shortest subsequence common to all DNA sequences in the given array of samples.
Input
samples=["AGTC","ATGC","AGC"]
Output
1
More Arrays problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards