week 2 poblem 04

time limit exceeded