Posts: 8,167
Threads: 160
Joined: Sep 2016
All of us - you and all good people here on the forum, will have hard time if you continue like this. As ndc85430 already explained you need to put some effort in solving the problem, try what is suggested, etc. Just keeping posting like this won't help.
Posts: 94
Threads: 8
Joined: Jan 2020
actually i am not sure in which branch of my code i should make changes and what changes should i make here to get desired input/output?
Thanks
Posts: 94
Threads: 8
Joined: Jan 2020
Mar-02-2020, 11:01 AM
(This post was last modified: Mar-02-2020, 11:47 AM by jk91.)
(Mar-02-2020, 09:52 AM)jk91 Wrote: actually i am not sure in which branch of my code i should make changes and what changes should i make here to get desired input/output?
Thanks any updates plese?
(Mar-02-2020, 11:01 AM)jk91 Wrote: (Mar-02-2020, 09:52 AM)jk91 Wrote: actually i am not sure in which branch of my code i should make changes and what changes should i make here to get desired input/output?
Thanks any updates plese? Actually i am not sure where to correct my code so need some help regarding same.
(Mar-02-2020, 11:01 AM)jk91 Wrote: (Mar-02-2020, 09:52 AM)jk91 Wrote: actually i am not sure in which branch of my code i should make changes and what changes should i make here to get desired input/output?
Thanks any updates plese?
(Mar-02-2020, 11:01 AM)jk91 Wrote: any updates plese? Actually i am not sure where to correct my code so need some help regarding same. however someone has just given some hints but that is not sufficient for me to understand where to correct and how to correct and what to correct to get desired input/output.
Thanks
(Mar-02-2020, 06:54 AM)buran Wrote: All of us - you and all good people here on the forum, will have hard time if you continue like this. As ndc85430 already explained you need to put some effort in solving the problem, try what is suggested, etc. Just keeping posting like this won't help.
I know you all you are experts but not everyone is expert here that is why they are seeking experts help here right?
so it is not that i am not making any effort but the thing is what effort should i make to get desired input/output.
(Mar-02-2020, 06:54 AM)buran Wrote: All of us - you and all good people here on the forum, will have hard time if you continue like this. As ndc85430 already explained you need to put some effort in solving the problem, try what is suggested, etc. Just keeping posting like this won't help.
I know you all you are experts but not everyone is expert here that is why they are seeking experts help here right?
so it is not that i am not making any effort but the thing is what effort should i make to get desired input/output. User has been warned for this post. Reason: Excessive thread bumping
Posts: 94
Threads: 8
Joined: Jan 2020
(Mar-02-2020, 11:01 AM)jk91 Wrote: (Mar-02-2020, 09:52 AM)jk91 Wrote: actually i am not sure in which branch of my code i should make changes and what changes should i make here to get desired input/output?
Thanks any updates plese?
(Mar-02-2020, 11:01 AM)jk91 Wrote: any updates plese? Actually i am not sure where to correct my code so need some help regarding same.
(Mar-02-2020, 11:01 AM)jk91 Wrote: any updates plese?
User has been warned for this post. Reason: Excessive thread bumping:- who put this remarks against my posts?
Actually i am not sure where to correct my code so need some help regarding same. however someone has just given some hints but that is not sufficient for me to understand where to correct and how to correct and what to correct to get desired input/output.
Thanks
(Mar-02-2020, 06:54 AM)buran Wrote: All of us - you and all good people here on the forum, will have hard time if you continue like this. As ndc85430 already explained you need to put some effort in solving the problem, try what is suggested, etc. Just keeping posting like this won't help.
I know you all you are experts but not everyone is expert here that is why they are seeking experts help here right?
so it is not that i am not making any effort but the thing is what effort should i make to get desired input/output.
(Mar-02-2020, 06:54 AM)buran Wrote: All of us - you and all good people here on the forum, will have hard time if you continue like this. As ndc85430 already explained you need to put some effort in solving the problem, try what is suggested, etc. Just keeping posting like this won't help.
I know you all you are experts but not everyone is expert here that is why they are seeking experts help here right?
so it is not that i am not making any effort but the thing is what effort should i make to get desired input/output. User has been warned for this post. Reason: Excessive thread bumping
Posts: 2,128
Threads: 11
Joined: May 2017
What is the definition of "good looking List"?
Posts: 94
Threads: 8
Joined: Jan 2020
(Feb-28-2020, 05:16 PM)ndc85430 Wrote: You need to spend some time trying to work out why the program isn't working as you want - we aren't here to do the work for you. Start by adding some extra print statements, to check that your variables have the values you expect and that the right branches are being entered. That will help narrow down where the problem is. in which branch i need to put wht desired code?
Posts: 1,838
Threads: 2
Joined: Apr 2017
You seem to be missing the point. You need to try things out for yourself, rather than expecting us to do the work for you. That's pretty much the definition of a help vampire. I think I'll bail out now, rather than continue to go in circles with you.
Posts: 1,358
Threads: 2
Joined: May 2019
Your sample data has 7 elements. Therefore it cannot all be paired. Start there.
SHOW YOUR WORK.
Posts: 94
Threads: 8
Joined: Jan 2020
ok,let's talk about case by case let's first focus on first case here:-
Sample Input 1:
3
1 3
0 2
4 5
Sample Output 1:
1
Explanation:
If we swap 0 and 3 list becomes (1,0),(3,2) and (4,5),which is a good looking list.
So any idea atleast how can we progress towards step by step achieving this goal?
Thanks
Posts: 1,358
Threads: 2
Joined: May 2019
In your code, line 101, pairs has 7 elements. You divide the count of elements by 2 to get the number of pairs (dropping remainder). You cannot pair everything up using that.
I get that a good looking list has pairs such that each element in the pair is one from the other, can be either order.
A for loop that has a step of 2 will let you assess pairs. A good looking pair will have an even number n and odd number n+1. If the pair is ugly then make a swap.
|