algo3: hw5: problem2 started