A sentence is a list of words that are separated by a single space with no leading or trailing spaces.
Given a sentence s and an integer k, return the sentence formed by the first k words of s.
Input: A comma-separated pair: sentence s and integer k.
Output: A string — the first k words of s joined by single spaces.
Input: Hello how are you Contestant,4
Output: Hello how are you
Explanation: First 4 words: 'Hello','how','are','you'.Input: What is the solution to this problem,4
Output: What is the solution
Explanation: First 4 words of the sentence.Input: chopper is not a tanuki,5
Output: chopper is not a tanuki
Explanation: k equals total word count — return full sentence.1 <= s.length <= 5001 <= k <= number of words in ss consists of words separated by single spaces