1class Solution:2def getMaxLen(self, words):3max_len = 04for word in words:5max_len = max(max_len, len(word))6return max_len78def printVertically(self, s: str) -> List[str]:9words = s.split()10max_len = self.getMaxLen(words)1112res = list()13for i in range(max_len):14s = ""15for word in words:16if i < len(word):17s += word[i]18else:19s += " "20s = s.rstrip()21res.append(s)22return res