#184. 字符串数组截取前N个元素

    ID: 184 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatAp-1gesp3一维数组字符串

字符串数组截取前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 NN strings. NN will be in the range 11 to the length of the original array.

Input Format

Input is given from standard input in the following format.

The first line contains MM strings, separated by spaces. The second line contains an integer NN.

Output Format

Output is printed to standard output in the following format.

A string representing the new array containing the first NN strings.

Sample

a b c d
1
["a"]
a b c d
2
["a\