Algorithm · Oracle · Medium
You are given a lowercase-only string s. Consider every non-empty contiguous substring that can be formed from s, and return the one that is largest under standard lexicographic order. Lexicographic order compares characters from left to right. The first character where two strings differ decides their order; if one string runs out before a difference is found, the longer string is considered larger. Example 1: Explanation: Starting at the first n gives "nana", which is…
Checking your access…