Skip to content

user27828/exercise_dna_sequence_match

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

exercise_dna_sequence_match

PHP Exercise - DNA Sequence Match

This was a code exercise requested for a role. I did not want the code to go to waste, so I'm releasing it here to assist anyone who might be trying to solve similar issues.
I am not a geneticist, nor have I played one on TV. Please do not throw this logic into your fancy new CRISPR machine!

Exercise Goals

(Quoted from original requirements)
DNA sequences are strings which contain only the letters A, C, G, and T. Two sequences are considered akin if they both contain sub-sequences which form an anagram of each other (e.g. ACG, GAC, GCA, and etc.).

In two given DNA sequences find the largest possible sub-sequence that would be considered akin. Output the length of the akin sub-sequence and it's position (0-based) in both input sequences.

Examples

InputResult
ACGT (first sequence)
GTC(second sequence)
3 (length)
1 (position in first sequence)
0 (position in second sequence)
ACGT
CAT
2
0
0
ACA
AC
 
2
0
0
ACA
GT
 
0
-1
-1

About

PHP Exercise - Grammatical Character Count

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages