Even-Odd Message

A message was encrypted with a simple shuffle: first all characters from even positions were written down, then all characters from odd positions. Given the encrypted string s, restore the original message. Split it into the even-position part and the odd-position part, then place their characters back by alternating positions.

Примеры

Ввод
"acebdf"
Вывод
"abcdef"
Ввод
"hloel"
Вывод
"hello"
Ввод
"a"
Вывод
"a"

Нужно реализовать

def decrypt_even_odd(s):

Теги

stringstwo-pointers
PostgreSQLv16

Tutaj pojawi się wynik wykonania kodu

Visible tests
1
Input
"acebdf"
Expected"abcdef"
2
Input
"hloel"
Expected"hello"
3
Input
"a"
Expected"a"
4
Input
"ab"
Expected"ab"
5
Input
"02413"
Expected"01234"
6
Input
"Tnofikf"
Expected"Tinkoff"
Focus radio
Paused · SomaFM · Fluid