Skip to content

Instantly share code, notes, and snippets.

@modos
Created September 27, 2023 20:23
Show Gist options
  • Save modos/fcde24fc2f5e34be86d6a39dd42cfb4c to your computer and use it in GitHub Desktop.
Save modos/fcde24fc2f5e34be86d6a39dd42cfb4c to your computer and use it in GitHub Desktop.
مایکل جردن
line = list(input())
l = 0
r = len(line) - 1
ans = ""
while (l <= r):
while (line[r] != 'x' and l <= r):
ans = line[r] + ans
r = r - 1
if (line[r] == 'x' and l <= r):
ans = line[r] + ans
r = r - 1
while (line[l] != 'x' and l <= r):
ans = line[l] + ans
l = l + 1
if (line[l] == 'x' and l <= r):
ans = line[l] + ans
l = l + 1
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment