RSSAmplifier

Andrew Odendaal

Longest Alphabetical Substring in Java

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

The challenge Find the longest substring of a string where characters are in non-decreasing alphabetical order . If multiple substrings share the maximum length, return the first one. Example: the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" is "aaaabbbbctt" (length 11). Inputs can be up to 10,000 characters, so the solution must be O(n). Solution 1: index tracking (fastest, O(1)…

Read on andrewodendaal.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.