Extraction I: Secret Message in the Noise

Extraction I: Secret Message in the Noise

A spy has hidden a secret message inside a string text of random characters. Your task is to extract the hidden message by pulling out every step-th character.

Input: Two arguments. String (str) and positive integer (int).

Output: String.

Examples:

assert extraction("hxeqlzlzow!", 2) == "hello!"
assert extraction("abcdefr", 2) == "acer"
assert extraction("dbcoefc", 3) == "doc"

Preconditions:

  • step > 0