<p>An <strong>alphabetical continuous string</strong> is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string <code>&quot;abcdefghijklmnopqrstuvwxyz&quot;</code>.</p>

<ul>
	<li>For example, <code>&quot;abc&quot;</code> is an alphabetical continuous string, while <code>&quot;acb&quot;</code> and <code>&quot;za&quot;</code> are not.</li>
</ul>

<p>Given a string <code>s</code> consisting of lowercase letters only, return the <em>length of the <strong>longest</strong> alphabetical continuous substring.</em></p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;abacaba&quot;
<strong>Output:</strong> 2
<strong>Explanation:</strong> There are 4 distinct continuous substrings: &quot;a&quot;, &quot;b&quot;, &quot;c&quot; and &quot;ab&quot;.
&quot;ab&quot; is the longest continuous substring.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;abcde&quot;
<strong>Output:</strong> 5
<strong>Explanation:</strong> &quot;abcde&quot; is the longest continuous substring.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
	<li><code>s</code> consists of only English lowercase letters.</li>
</ul>

class Solution:
    def longestContinuousSubstring(self, s: str) -> int:
        s1="abcdefghijklmnopqrstuvwxyz"

        index = 0

        l=len(s)
        longlen=0
        maxlen=1
        ###tempi=0
        tempi=s1.find(s[index])

        while index<l:#& and tempi<26:
            #$#$#$print("starting index at:",index,"('",s[index] ,"') in given s)")
            #$#$#$print("starting tempi at:", tempi,"('",s1[tempi] ,"') in alphabet s1)")
            if s[index]==s1[tempi]:
                #$#$#$print("MATCH FOUND!")
                longlen+=1 #if tempi<25 else -25
                ##**##tempi+=1 
                
                #$#$#$print("longlen increased to:",longlen)
                maxlen=max(maxlen,longlen)
                #$#$#$print("maxlen:",maxlen)
                index+=1
                #$#$#$print("index increased to:",index)
                if tempi<25:
                    tempi+=1
                else: 
                    tempi=s1.find(s[index]) if index<l else 0
                    longlen=0
                    #$#$#$print("longlen reset to:",longlen,"due to end of line of alphabets s1")
                #$#$#$print("tempi increased to:", tempi)
                

            else:
                #$#$#$print("target '",s[index],"' found at:",s1.find(s[index])," of s1 (alphabet)")
                longlen=0
                #$#$#$print("longlen reset to",longlen)
                #$tempi=0
                tempi=s1.find(s[index])
                #$#$#$print("tempi reset to:", tempi)
                
            #$index+=1
            #$print("index increased to:",index)
        #$#$#$print("final maxlen:",longlen)
        return maxlen
448