algorithms hw#3 probs 1,2 in python