LinkedIn Interview Question

How to find the last substring with highest lexicographical