Filtering a list by string length
Kotlin
Easy
lambdas
Task «Filtering a list by string length»
Write a program that reads an integer N, then reads N lines. Using a lambda expression, filter out lines whose length is greater than 3 characters. Output the filtered lines in the same order, each on a new line. If there are no filtered lines, output "NO".
Input Format
First line: an integer N (1 ≤ N ≤ 100). Then N strings, each on a separate line. The strings can contain any characters except spaces.
Output Format
Output the filtered lines (length > 3) in their original order, each on a new line. If there are no such lines, output "NO".
Examples
Example 1
INPUT
3
1 2 3
OUTPUT
1 2 3
Example 2
INPUT
4
hello
hi
kotlin
java
OUTPUT
hello
kotlin
java
Example 3
INPUT
1
5
OUTPUT
NO
main.kt