sundry/python/foobar/two/max_eq.py
2016-08-30 10:56:01 -06:00

13 lines
335 B
Python

#!/usr/bin/env python
samples = [ [[1,4,1],3], [[1,2],1] ]
def answer(x):
"""Find the number of cars that can be made an equal weight via bunny redistribution between cars"""
remainder = sum(x)%(len(x))
return len(x) if (remainder==0) else len(x)-1
for sample in samples:
print answer(sample[0])
print sample[1]