Extraction III: Backward Secrets
The mission is in Blocked Mode.
Access to the solutions is blocked for a day or two (even after you share your own), until we'll have enough solutions for you to check.
All users who've solved the mission will get the notifications about their opening.
The spy is clever – the message may be hidden backwards. Update your function to also accept a rev parameter with default value False. If True, decoding should proceed from the end of the string toward the beginning.
Input: Four arguments. String (str), positive and non-negative integers (int), boolean value (bool).
Output: String.
Examples:
assert extraction("aenlbapyaokroownuigsqazcxqa", 2, 3, True) == "casinoroyale"
assert extraction("NOHTYP", 4, 1, True) == "YN"
assert extraction("eiiodnteellddfnqarezvpihlm", 2, 1, True) == "liveandletdie"
assert extraction("987654321", 3, 2, True) == "369"
Preconditions:
- step > 0;
- start >= 0.