solved problem-4 in 136 bytes