Practice Length of the Longest Alphabetical Continuous Substring
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
An alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string "abcdefghijklmnopqrstuvwxyz". Given a string s consisting of lowercase letters only, return the length of the longest alphabetical continuous substring.
Source: Length of the Longest Alphabetical Continuous Substring on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "abacaba"
2
# Example 2
s = "abcde"
5
Constraints
Related LeetCode Problems
Practice more problems similar to Length of the Longest Alphabetical Continuous Substring.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.