Fix: Ensure all skills are tracked as files, not submodules

This commit is contained in:
sck_0
2026-01-14 18:48:48 +01:00
parent 7f46ed8ca1
commit 8bd204708b
1113 changed files with 82065 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
def decode_cyclic(s: str):
"""
takes as input string encoded with encode_cyclic function. Returns decoded string.
"""
# split string to groups. Each of length 3.
groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]
# reverse the cycle operation: shift the last character to the front
# encode does: abc -> bca (shift left)
# decode should: bca -> abc (shift right, i.e., last char to front)
groups = [(group[-1] + group[:-1]) if len(group) == 3 else group for group in groups]
return "".join(groups)