Created
September 27, 2023 20:23
-
-
Save modos/fcde24fc2f5e34be86d6a39dd42cfb4c to your computer and use it in GitHub Desktop.
مایکل جردن
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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