Given an array of words and a maximum width maxWidth, pack words greedily into lines so each line holds as many words as fit (with at least one space between words). Return the number of lines used. Input: '[words], maxWidth'.
Input: '[words], maxWidth'.
Output: Integer — number of lines.
Input: ["This","is","an","example"], 16
Output: 2
Explanation: 'This is an' then 'example'.Input: ["a","b","c","d"], 5
Output: 2
Explanation: 'a b c' then 'd'.Input: ["word"], 10
Output: 1
Explanation: Single line.1<=words.length<=3001<=word length<=maxWidth<=100