solution to Length of Last Word