X478: Hashmap - Java's HashMap 1

Octavia has given you a list of movies. She is tired of deciding what to watch by name and now wants to be able to pick them by the length of the title. Organize this list of movies for Octavia! The movies will be given as an array of strings. A Hash Map will need to be declared that keys each value in the array based on the length of each string.

Example:
"Double Down" keys to 11
"I am Here, Now" keys to 14
"Fateful Findings" keys to 19
"Pass Thru" keys to 9

Java's built in Hash Map is enabled for this problem. The API can be viewed here: https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.