Genome Sequencing puzzle discussion

I did some optimizations to reduce the search space, and so in my case maximum N among testcases was 3.
This made me wonder what’s the point of even mentioning “dynamic programming” in puzzle description. With such small N brute-forcing over permutations will just be more efficient.
Nonetheless, I have implemented Held-Karp algorithm and tested it on sequences of up to 15-16 elements.

1 Like

I too would like to know what the “Multi-Solutions” actually test for? Is it that N is larger than 3? I can see that the limitations are 6 but how would you go about such a genome? When the sequence must contain all other sub-sequences

I was stuck on this one (“Almost superimposed”) for quite some time, and now I feel a bit stupid about it… if anyone’s having trouble passing this test case, I recommend the following custom case:

3
AAC
TC
TTAACCTT

Shortest string will be “TTAACCTTC” (9). Hope this helps!

2 Likes

The strange thing is - my code does return 9 on this testcase. And still fails in “Almost Superimposed”.

I need to read through the code and debug that code to figure out what is wrong.

I did end up writing it from scratch and solved it 100%.

Kudos to the codingame team for the history of submissions. I can revisit my old code and find out what went wrong. Will get on it once I go through all the other games.

My algorithm passed all the tests except
7. Sequence included
8. Sequence included, reverse order

Could anyone please suggest test inputs for this cases?
I’ve already tried the cases mentioned in this topic and they are all OK.

I’ve found the flaw in my logic and now it works fine.
It turns out I had incorrect priorities when deciding how to concatenate strings (I checked first if they intersect and then if they did not, I checked for inclusion, which was incorrect)

1 Like

I’m bit disappointed. I spent a lot of time trying to develop solution using dynamic programming with multi-dimension arrays. But this is not needed as simplest solution works as well, even notoptimized.

Thanks a lot man, i was stuck on this particular validator and your test case helped me find my mistake.
Cheers.

I also failed this test case only. The input that helped me is:
3
TAA
TTB
TAACCTT

and output must be:
TAACCTTB which is 8

2 Likes

Glad I could help! :slight_smile:

I am looking for Test Cases for:
-Multi-solutions
-Mirror, reverse order
-Mirror
-Example 3, but with the first two words nested

Thank you, was only missing this test, it made my day :slight_smile:

Hello! it’s possible to show some exemple for test 13 (Sequences included and disjointed) plz ?

Best test case for “Almost superimposed”, got me to 100%. Thanks!

Great task. But that A+C=AC should be included in the tests: don’t make people guess what’s wrong when they have 100% tests and 93% validations passed. Especially when the problematic validator has such misleading name (AC is input too, not output).

My code also fail on “Sequences included and disjointed” all test case from previous reply are here
[‘BACA’, ‘GATTACA’, ‘TT’] = 11
CA, TCAT, CAGG = 8
ATAC, TAC, GT = 6

I think it’s all correct, right ?
Have no idea anymore.

3 Likes

Hey, I’m mostly curious about whether if I solve this problem properly, would I actually be solving a real problem.

I mean is this genome sequencing problem like something that real geneticists deal with?

3
TT
AA
ACT
I think this gives TTAACT which length is 6 but the testcase output is 5
Can someone please explain me this!!!

The explanation is in the name of the test case :wink:

:sweat_smile: :roll_eyes: :roll_eyes:
All my testcases are Ok but this one :sneezing_face: :sneezing_face: :sneezing_face: