Company: Capital One_30june
Difficulty: medium
Newspaper Page 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 , start a new line. If a line has less than width characters, align the text to the center by adding spaces around it: If the amount of le