#193. 字符串按长度筛选

    ID: 193 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatAp-1gesp1循环结构条件结构

字符串按长度筛选

Filter Strings by Length

Background

None.

Problem Description

Given an array of strings, return a new list (e.g., an ArrayList) where all strings of a specified length are omitted.

Input Format

The input is given from standard input in the following format. The first line contains an integer NN, representing the number of strings in the array. The second line contains NN strings, separated by spaces. The third line contains an integer LL, representing the length of strings to be omitted.

NN S1S_1 S2S_2 ... SNS_N LL

Output Format

Output a list containing all strings from the original array whose length is not LL. The strings should be separated by commas and spaces, enclosed in square brackets [].

[string1, string2, ..., stringK]

Sample

4
a bb b ccc
1
["bb\