#184. 字符串数组截取前N个元素
字符串数组截取前N个元素
Get First N Strings
Background
In daily programming tasks, we often need to extract a specific number of elements from a collection. For example, retrieving the first few items from a long list for preview or processing.
Problem Description
Given an array of strings, return a new array containing the first strings. will be in the range to the length of the original array.
Input Format
Input is given from standard input in the following format.
The first line contains strings, separated by spaces. The second line contains an integer .
Output Format
Output is printed to standard output in the following format.
A string representing the new array containing the first strings.
Sample
a b c d
1
["a"]
a b c d
2
["a\