Guest User

Untitled

a guest
Feb 12th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. twinGap = 0 // current gap between twins
  2. count = 0
  3. maxTwinGap = 0 // max gap between twins
  4.  
  5. // while loop goes through all entries of list twins
  6. while count < len(twins):
  7.  
  8. // gap between twins is the list entry of index count + 1 (a tuple)
  9. // the [1] selects the second entry in the tuple
  10. twinGap = twins[count+1][1] - nextP
  11.  
  12. // if the current twinGap is > maxTwinGap, we have a new maxTwinGap
  13. if twinGap > maxTwinGap:
  14. maxTwinGap = twinGap
  15.  
  16. // loop update condition
  17. count +=1
  18.  
  19. print twinGap
Add Comment
Please, Sign In to add comment