solve problem55 by implementation, easy