from itertools import combinations def check(iterPeople, n): result = [] for peoples in iterPeople: iList, oList = [], [] for people in peoples: iList.append(people['inFu']) #想要的福卡 oList.append(people['outFu']) #给出的福卡 iSet, oSet = set(iList), set(oList) if iSet == oSet and len(iSet) == n: result.append(peoples) return result def matchResult(n): people = people # 登记需求的用户 result = check(combinations(people, n), n) return result
1 CodeingBoy 2017-01-19 18:09:27 +08:00 ![]() 想要的福卡只能挑一个……那为什么要做成多选的→_→ |
![]() | 2 deleted OP @CodeingBoy 这正是跨时代的前端不验证,只在后端验证啊 |
4 CodeingBoy 2017-01-19 18:26:41 +08:00 ![]() |
![]() | 5 deleted OP @CodeingBoy 支付宝隐私是设置了不验证,后来才发现不在通讯录还是要验证 |
![]() | 7 jadecoder 2017-01-19 20:37:54 +08:00 这个真的 666 |
![]() | 8 velee 2017-01-19 20:52:55 +08:00 我就知道有程序员无聊会做这个,为楼主的执行力点赞! |
![]() | 9 Arcus 2017-01-19 21:08:57 +08:00 via Android 怕是不符合价值观,封你支付宝账号 |
![]() | 10 shyrock 2017-01-20 14:53:58 +08:00 不错不错,思路和行动力都不错 |
![]() | 11 0747916 2017-01-20 15:04:17 +08:00 good job |
![]() | 12 0747916 2017-01-20 15:06:56 +08:00 前端:我有一句 xxx 不知当讲不当讲 233 |
13 solmur 2017-01-21 21:48:53 +08:00 via Android 试试看 |
![]() | 14 SoulGem 2017-01-22 15:41:23 +08:00 默默地看了一眼 ngrok 的域名…… |