Render a flat list into rows of size k (last row may be short). Input: line 1 — k; line 2 — JSON array. Print one row per line: items joined by |.
|
Input: two lines. Output: one row per line.
Your program reads from stdin and prints to stdout.
Example 1
Input: 2 ["a","b","c","d","e"]
Output: a|b c|d e
Hints