Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def smartAssigning(information)
- array_length = information.length
- x = 0
- projects = 0
- tasks = 0
- name = ""
- while (x < array_length)
- if information[x][1].to_i == 1 and (information[x][3].to_i < tasks or tasks == 0) then
- name = information[x][0]
- projects = information[x][2].to_i
- tasks = information[x][3].to_i
- end
- if information[x][1].to_i == 1 and information[x][3].to_i == tasks and information[x][2].to_i < projects then
- name = information[x][0]
- projects = information[x][2].to_i
- tasks = information[x][3].to_i
- end
- x = x + 1
- end
- return name
- end
Advertisement
Add Comment
Please, Sign In to add comment