problem 5 bruteforce + smartway #1