Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
team pair issue
#11
ok,but where to add those extra print statements and which are the right branches which could satisfy below conditions in this program:-

nput:-
First line contains one integer 1<=N<=1000,number of pairs.
Next N line contains 2 space separated integers representing a pair {i,j} in current list.

Output Format:-

Print one integer,that is minimum number of swaps needed to make the list good looking

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.


Sample Input 2:

2
3 2
0 1

Sample Output 2:

0


Explanation:

List is already good looking.
Reply


Messages In This Thread
team pair issue - by jk91 - Feb-28-2020, 07:03 AM
RE: team pair issue - by ndc85430 - Feb-28-2020, 08:19 AM
RE: team pair issue - by jk91 - Feb-28-2020, 10:24 AM
RE: team pair issue - by jefsummers - Feb-28-2020, 11:40 AM
RE: team pair issue - by jk91 - Feb-28-2020, 01:37 PM
RE: team pair issue - by jefsummers - Feb-28-2020, 03:01 PM
RE: team pair issue - by jk91 - Feb-28-2020, 03:56 PM
RE: team pair issue - by ndc85430 - Feb-28-2020, 04:21 PM
RE: team pair issue - by jk91 - Feb-28-2020, 04:59 PM
RE: team pair issue - by ndc85430 - Feb-28-2020, 05:16 PM
RE: team pair issue - by jk91 - Mar-02-2020, 02:05 PM
RE: team pair issue - by jk91 - Feb-29-2020, 05:51 AM
RE: team pair issue - by ndc85430 - Feb-29-2020, 06:00 AM
RE: team pair issue - by jk91 - Feb-29-2020, 07:38 AM
RE: team pair issue - by ndc85430 - Feb-29-2020, 07:42 AM
RE: team pair issue - by jk91 - Feb-29-2020, 10:05 AM
RE: team pair issue - by ndc85430 - Feb-29-2020, 11:02 AM
RE: team pair issue - by jk91 - Feb-29-2020, 12:22 PM
RE: team pair issue - by ndc85430 - Feb-29-2020, 12:36 PM
RE: team pair issue - by jefsummers - Feb-29-2020, 03:07 PM
RE: team pair issue - by jk91 - Mar-02-2020, 06:50 AM
RE: team pair issue - by buran - Mar-02-2020, 06:54 AM
RE: team pair issue - by jk91 - Mar-02-2020, 09:52 AM
RE: team pair issue - by jk91 - Mar-02-2020, 11:01 AM
RE: team pair issue - by jk91 - Mar-02-2020, 01:48 PM
RE: team pair issue - by DeaD_EyE - Mar-02-2020, 01:56 PM
RE: team pair issue - by ndc85430 - Mar-02-2020, 04:47 PM
RE: team pair issue - by jefsummers - Mar-02-2020, 04:48 PM
RE: team pair issue - by jk91 - Mar-03-2020, 04:10 PM
RE: team pair issue - by jefsummers - Mar-03-2020, 06:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting the maximum value:key pair from a dictionary sean1 2 1,492 Jan-17-2022, 01:04 PM
Last Post: DeaD_EyE
  How to extract specific key value pair from string? aditi06 0 2,588 Apr-15-2021, 06:26 PM
Last Post: aditi06
  Auto re-pair / re-sync Controller via Script? User3000 2 2,401 Nov-30-2020, 11:42 AM
Last Post: User3000
  Search a List of Dictionaries by Key-Value Pair; Return Dictionary/ies Containing KV dn237 19 6,928 May-29-2019, 02:27 AM
Last Post: heiner55
  Key Value Pair output UtiliseIT 9 4,828 May-03-2019, 07:30 AM
Last Post: buran
  Parsing Text file having repeated value key pair using python manussnair 3 3,352 Aug-04-2018, 11:48 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020