Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import sys
- # Functions
- def is_subsequence(s, t):
- ''' Return whether or not s is a subsequence of t '''
- index = 0
- for letter in t:
- if s[index] == letter:
- index += 1
- if index == len(s):
- return True
- return False
- # Main Execution
- if __name__ == '__main__':
- for line in sys.stdin:
- s, t = map(list, line.split())
- print(is_subsequence(s, t))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement