algo3: hw6: problem3 trying solving 1