1) specs를 객체로 만든다.
2) names를 순회(for)하면서, max_weight -= specs[name]
3) max_weight가 specs[name]보다 작은 경우, count+=1하고 limit=max_weight
4) for문이 끝나면 return count
def solution(max_weight, specs, names):
specs = dict(specs)
count = 1
limit = max_weight
for name in names:
if limit < int(specs[name]):
count += 1
limit = max_weight
limit -= int(specs[name])
return count