given a string write a function to return the index of the first elememt which is non-alphabat ordered
Anonymous
#Python #total running time = O(n) def search_nonAlphabet(s): s = s.lower() for i in range(len(s)-1): if s[i+1] < s[i]: #print(s[i], i) return i s = 'AbcHowAreYou' search_nonAlphabet(s)
Check out your Company Bowl for anonymous work chats.