best solution for 47

best solution for 47