Company: Visa_1july
Difficulty: medium
Newspaper Text Formatting Problem Description You are formatting the text on a newspaper page. You have to align the text on the page properly. The text is provided to you in the following format: paragraphs is an array of paragraphs, where each paragraph is represented as an array containing portions of text. width represents the maximum number of characters each line of the newspaper page can include. Your task is to produce a newspaper page according to the following specifications: Start a new line for each paragraph, paragraphs[i] . Add all paragraph words paragraphs[i][j] in order. When words are together on a line, they should be separated by 1 space. Every paragraph word paragraphs[i][j] is guaranteed to contain only lowercase and uppercase English letters. You can't break up words. So, if adding the next word would cause you to exceed width , you will need to start a new line and add the word there. You may end up with leftover space on a line if the size of the text that fit