Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- s = input()
- i = 0
- result = ''
- while i < len(s):
- skip = 0
- if s[i] == 'l' and i <= len(s) - 3:
- j = i + 1
- while j < len(s) and s[j] == 'o':
- j += 1
- if s[j:j + 1] == 'l' and j > i + 1:
- skip = j - i + 1
- elif s[i] == 'k' and i <= len(s) - 3:
- j = i + 1
- while j < len(s) and s[j] == 'e':
- j += 1
- if s[j:j + 1] == 'k' and j > i + 1:
- skip = j - i + 1
- if skip > 0:
- i += skip
- else:
- result += s[i]
- i += 1
- print(result)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement