Freshworks interview question

Find longest substring from a given string