07-31-2018 01:09 AM
I want to find array pair of given sum.
In my code i found for only for first index.
what mistake i have done in my program please correct it asap
Solved! Go to Solution.
07-31-2018 01:07 AM
I want to find array pair of given sum.
In my code i found for only for first index.
what mistake i have done in my program please correct it asap
07-31-2018 01:26 AM - edited 07-31-2018 01:42 AM
Some hints:
(and please don't maximize the diagram to the screen, that's annoying!)
07-31-2018 01:35 AM
please give me the solution how can i remove duplicte pairs that are comming in pair array.
thank you
07-31-2018 01:51 AM
I gave you a lot of hints already. Is this homework or a real-life professional problem?
We don't do homework, but we usually help to get on the right track.
07-31-2018 08:43 AM
From your description, I don't really understand your (homework?) assignment, but presumably, you do. So here is a suggestion:
Some suggestions and "facts you should know" --
Bob Schor
07-31-2018 11:05 AM - edited 07-31-2018 11:07 AM
@certified wrote:
please give me the solution how can i remove duplicte pairs that are comming in pair array.
You get duplicates for two different reasons:
From the problem description it is also not clear if the same element can be used twice. For example if the desired sum is 4 and only one element is 2, is 2+2 = 4 an allowed solution?
08-04-2018 02:04 PM
Since you probably learned something by now, here's a simpler, more interesting, but similar problem:
Given an positive integer A, find all possible pairs of positive integers that add up to A.
See how far you get... 😄