X239: listLength

Write a method called listLength() that takes in a list of strings and returns a list of their lengths as integers. You must create a new list for your answer.

Examples:

listLength(list("", "a", "ab", "abc")) -> list(0, 1, 2, 3)
listLength(list("hello world")) -> list(11)
listLength(list()) -> list()

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.