You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
316 B

import Data.List as L
main = do content <- getContents
putStr $ unlines $ map unwords $ L.transpose $ map (completeMatrix ' ') $ L.transpose $ completeMatrix "" $ map words $ lines $ content
where completeMatrix v m = map (\e -> e ++ [v| _ <- [length e .. (\ x -> maximum $ map length x) m ]]) m