Complete the code to create a new empty hash map.
let mut map = std::collections::HashMap::[1]();The new function creates an empty HashMap to store values.
Complete the code to check if the complement exists in the map.
if let Some(&index) = map.[1](&complement) {
The get method checks if the complement key exists in the map.
Fix the error in the code to insert the current number and its index into the map.
map.[1](nums[i], i);The insert method adds a key-value pair to the map.
Fill both blanks to complete the loop and calculate the complement.
for [1] in 0..nums.len() { let complement = [2] - nums[i];
The loop variable is i and the complement is target - nums[i].
Fill all three blanks to return the indices of the two numbers that add up to the target.
return vec![index, [1]]; } map.[2](nums[[3]], [3]);
Return the current index i, insert the current number and index into the map.
