Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pairs(boys, girls, diff, x=False):
- a = 0
- to_return = 0
- if len(boys) == 0 and len(girls) == 0:
- if x == False:
- return 0
- return 0
- for index1, value1 in enumerate(boys):
- for index2, value2 in enumerate(girls):
- if abs(value2-value1) <= diff:
- #print boys[0:index1] + boys[index1 + 1:], girls[0:index2] + girls[index2 + 1:]
- a = 1 + pairs(boys[0:index1] + boys[index1 + 1:],girls[0:index2] + girls[index2 + 1:], diff , True)
- if to_return<a:
- to_return = a
- return to_return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement