finish longest substr