6 kyu

Longest alphabetical substring

1,174 of 3,154Avanta

Description:

Find the longest substring in alphabetical order.

Example: the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" is "aaaabbbbctt".

There are tests with strings up to 10 000 characters long so your code will need to be efficient.

The input will only consist of lowercase characters and will be at least one letter long.

If there are multiple solutions, return the one that appears first.

Good luck :)

Fundamentals
Strings

More By Author:

Check out these other kata created by Avanta

Stats:

CreatedFeb 10, 2018
PublishedFeb 10, 2018
Warriors Trained6688
Total Skips382
Total Code Submissions11548
Total Times Completed3154
Python Completions1174
JavaScript Completions1201
Haskell Completions51
Elixir Completions20
Ruby Completions265
Java Completions524
Nim Completions9
Total Stars133
% of votes with a positive feedback rating93% of 538
Total "Very Satisfied" Votes470
Total "Somewhat Satisfied" Votes60
Total "Not Satisfied" Votes8
Total Rank Assessments5
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Avanta Avatar
  • anter69 Avatar
  • myjinxin2015 Avatar
  • docgunthrop Avatar
  • JohanWiltink Avatar
  • metagn Avatar
  • Instructor Avatar
  • ejini战神 Avatar
  • saudiGuy Avatar
Ad