Created
October 25, 2015 21:40
-
-
Save popey456963/00401723ae737b86f7a9 to your computer and use it in GitHub Desktop.
Skillful Thinking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
project_skills = input().split(" ") | |
worker_skills = [] | |
n = int(input()) | |
for i in range(n): | |
worker_skills.append(input().split(" ")) | |
top = 99999 | |
for i in range(100): | |
worker_skills = random.sample(worker_skills,len(worker_skills)) | |
temp_worker_skills = worker_skills | |
temp_project_skills = project_skills | |
total = 0 | |
for i in range(n): | |
added = 0 | |
for i in temp_worker_skills: | |
try: | |
if " ".join(i) in " ".join(temp_project_skills): | |
found = temp_project_skills.index(i) | |
temp_project_skills.pop(found) | |
added = 1 | |
except: | |
pass | |
if added == 1: | |
total += 1 | |
if total < top: | |
top = total | |
print(top) |
developius
commented
Oct 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment