Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def pairs(boys, girls, diff, x=False):
  2. a = 0
  3. to_return = 0
  4. if len(boys) == 0 and len(girls) == 0:
  5. if x == False:
  6. return 0
  7. return 0
  8. for index1, value1 in enumerate(boys):
  9. for index2, value2 in enumerate(girls):
  10. if abs(value2-value1) <= diff:
  11. #print boys[0:index1] + boys[index1 + 1:], girls[0:index2] + girls[index2 + 1:]
  12. a = 1 + pairs(boys[0:index1] + boys[index1 + 1:],girls[0:index2] + girls[index2 + 1:], diff , True)
  13. if to_return<a:
  14. to_return = a
  15. return to_return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement