I want to make a program that cross checks strings.
Here is an example :
Enter line: AAGGAA
This sequence can make a hairpin
Enter line: UGAG
This sequence cannot make a hairpin
Enter line: GUGCCACGGCACCGUG
This sequence can make a hairpin
Enter line: GUACCACGGCACCGUG
This sequence cannot make a hairpin
My challenge states
Your task is to write a program which reads in a sequence of RNA and determines whether or not it could, if folded in the middle, form a hairpin structure. All sequences that we use to test your program will be of even length.
Basically it splits strings which are even and cross checks those strings if they can make a hairpin sequence.
so if the string AAGGAA was entered,
it would be split into AAG and GAA and the first letter of string one has to match the last letter of string two, and so on.
Can someone please help me?
I've tried coding it but have had no luck :(