solution for length of last word