<s> __author__ = "<STR_LIT>" <EOL> def find_substr ( s1 , s2 ) : <EOL> if len ( s1 ) < len ( s2 ) : <EOL> bs = s2 <EOL> ss = s1 <EOL> else : <EOL> bs = s1 <EOL> ss = s2 <EOL> ps = <NUM_LIT:0> <EOL> for c in bs : <EOL> if ss [ ps ] == c : <EOL> ps += <NUM_LIT:1> <EOL> else : <EOL> ps = <NUM_LIT:0> <EOL> if ps == len ( ss ) - <NUM_LIT:1> : <EOL> return True <EOL> return False <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> s1 = '<STR_LIT>' <EOL> s2 = '<STR_LIT>' <EOL> s3 = '<STR_LIT>' <EOL> assert ( find_substr ( s2 , s1 ) == True ) <EOL> assert ( find_substr ( s3 , s1 ) == False ) </s>
