Skip to content

Commit cc1bbe5

Browse files
committed
🪙 S5-1343
1 parent c69a3f4 commit cc1bbe5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

🪙 S5/1343.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
n = input()
2+
res = [0]*len(n)
3+
i = 0
4+
while i < len(n):
5+
if n[i] == ".":
6+
res[i] = "."
7+
i += 1
8+
elif i <= len(n)-4 and n[i:i+4] == "XXXX":
9+
for j in range(i, i+4):
10+
res[j] = "A"
11+
i += 4
12+
elif i <= len(n)-2 and n[i:i+2] == "XX":
13+
for j in range(i, i+2):
14+
res[j] = "B"
15+
i += 2
16+
else:
17+
print(-1)
18+
exit()
19+
20+
print("".join(res))

0 commit comments

Comments
 (0)