7 Hour time limit up for homework 8

i found this one hard and i am sad that i was only able to finish 1 a
and b