Tap here to switch tabs
Problem
Submissions

Problem: Print Words Vertically

med
30 min
Try to solve the Print Words Vertically problem.

Statement

Given a string s, return a list of strings representing all the words printed vertically in the order they appear in s.

Words are separated by single spaces. Shorter words must be padded with spaces if a character at that position is missing, but trailing spaces are not allowed at the end of any output string.

Note: Each output string represents the characters at the ii-th index across all words in s, with trailing spaces stripped.

Constraints:

  • 1≤1 \leq s.length ≤200\leq 200

  • s contains only uppercase English letters and spaces.

  • It is guaranteed that there is only 11 space between 22 words.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Print Words Vertically

med
30 min
Try to solve the Print Words Vertically problem.

Statement

Given a string s, return a list of strings representing all the words printed vertically in the order they appear in s.

Words are separated by single spaces. Shorter words must be padded with spaces if a character at that position is missing, but trailing spaces are not allowed at the end of any output string.

Note: Each output string represents the characters at the ii-th index across all words in s, with trailing spaces stripped.

Constraints:

  • 1≤1 \leq s.length ≤200\leq 200

  • s contains only uppercase English letters and spaces.

  • It is guaranteed that there is only 11 space between 22 words.