Question: When writing a function in C++ that takes a vector with int int values from 0 to 99 and returns an array-based map that stores
When writing a function in C++ that takes a vector with int int values from 0 to 99 and returns an array-based map that stores the index into the vector where that value first appeared for every unique number, should I parse it for unique values first using a for loop? When I parse it (if that is what I'm supposed to do), should I use an if statement that adds the index into the vector if it is found? How do I turn it into array-based map to return?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
