Vertical Cipher
Given a string s and an integer k, rearrange s into k rows so that s can be read vertically (top-down, left to right).
Constraints
n ≤ 10,000wherenis the length ofsk ≤ 1,000
https://binarysearch.com/problems/Vertical-Cipher
Examples
Example 1
Input
- s =
abcdefghi - k =
5
Output
- answer =
['af', 'bg', 'ch', 'di', 'e']
Explanation
This reads vertically as:
["af",
"bg",
"ch",
"di",
"e"]
Leave a comment