title: Compare elements of two list
body: <p>I have been given two lists, say list1 and list2. I have to arrange the elements of the list1 in such a way that at particular index the element of list1 is greater than the element of list2. We have to find how many such elements of list1 are there.
  For example:</p>
  
  <pre><code>list1=[20,30,50]
  list2=[60,40,25]
  </code></pre>
  
  <p>Here only element index 2 is greater i.e. 50>25, but if we swap 50 and 30 in list1 
  So,</p>
  
  <pre><code>list1=[20,50,30]
  list2=[60,40,25]
  </code></pre>
  
  <p>then 50 > 40 ( at index 1) and 30 > 25 (at index 2). So we got 2 elements 50 and 30 which are greater at their respective index.
  Here is my approach</p>
  
  <pre><code>def swap(a,b):
      a,b=b,a
      return a,b
  n=3
  g=list(map(int,input().split()))
  o=list(map(int,input().split()))
  c=0
  for i in range(n):
      if o[i]&gt;g[i]:
          for j in range(i+1,n):
              if g[j]&gt;o[i]:
                  g[i],g[j]=swap(g[i],g[j])
                  c+=1
                  break
      else:
          c+=1
  print(c)
  </code></pre>
  
  <p>But for </p>
  
  <pre><code>list1= [3,6,7,5,3,5,6,2,9,1]
  list2= [2,7,0,9,3,6,0,6,2,6]
  </code></pre>
  
  <p>Its giving c=6 but expected output is c=7</p>