Mission 7: "Instant Roster Lookup" 📇
The first step is to populate the hash map with the crew data.
00:00
Mission Objective
Given a `rosterMap` and a `crewMember` object with an `id`, add the crew member to the map. The key should be the member's ID.
Step 1 / 2
1. The Story: The Mission Briefing
"The ship's security system needs to look up a crew member's clearance level instantly using only their unique ID string. Searching the crew array every time is too slow and triggers an alarm."
2. The Problem
How do you get near-instant access to data using a non-numeric key?
3. The Task
You will refactor the crew roster from an array of objects to a Hash Map, where the keys are the crew member IDs. You will then write a function that retrieves a crew member's data, experiencing the incredible speed of an O(1) lookup.
4. Concepts Applied
Practical implementation of Hash Maps for fast data retrieval.