Mar-02-2020, 06:50 AM
(Feb-29-2020, 03:07 PM)jefsummers Wrote: Think about it. You are using a 1D array (list) to store your numbers and define your pairs as x[n] and x[n+1]. Is this the best way, or should you use actual pairs?
What are you doing to prevent accidentally stranding numbers making the task impossible? For example, if your list has the numbers 0,1,2,3,4,5 and you have one of your pairs as 1,2, that is a "good looking pair" but 0 can never be paired to be good looking (hint - all pairs must have the even number as the lower number and the odd as lower+1).
That should get you going. Show your work along with intermediate results.
I am not sure which way is best here only thing i am concerned to solve it as soon as possible,as i have been struggling with this complex problem for a long time now.if any one could please tell me exactly what corrections i should make in my existing code to get desired input/output then it would be much aprrecited.
Thanks