hello, i'm trying to write a function in C that finds two subsequences
that thier sum is equal. hope you can help me. thank you!

hello, i'm trying to write a function in C that finds two subsequences
that thier sum is equal. hope you can help me. thank you!

What code have you tried yet?

i did'nt try anything yet, cause i can manage to think of an idea that can check all the option. what makes the question harder is that no number can be left out side of one of the Subsequence.
for example {1,2,3,5,6}- 1,2,3 and 6, so 5 is outside

Well, what have you got sofar?

unfortunatly i did'nt try anything yet, cause i can manage to think of an idea that can check all the options. what makes the question harder is that no number can be left out side of one of the Subsequence.
for example {1,2,3,5,6}- 1,2,3 and 6, so 5 is outside

You do not have to use ALL the numbers in your subsequences!
So 1,2,3 is a subsequence and 6 is a subsequence, so OK!
Other example 3,5 and 2,6. etc.

You do not have to use ALL the numbers in your subsequences!
So 1,2,3 is a subsequence and 6 is a subsequence, so OK!
Other example 3,5 and 2,6. etc.

i'm sorry i didn't explian myself well. my program have to use all the numbers. In the {1,2,3,5,6} example 5 can't be left outside!.

Then explain your definition of a subsequence. Would 1,3,5 and 1,2,6 be allright?

yes it will be alright as long as the sequence is {1,2,6,3,5,1}

So what is your definition of a subsequence? I still don't understand what you are saying at all.

i need to find two subsequences of a sequence that includes all the number in the sequence that it.
a subsequence can be everything but i need two that includes all the numbers in the sequence

This article has been dead for over six months. Start a new discussion instead.