Question: Find the positions of all strings equal to a given string in a vector of strings. Instead of stopping at the first match, collect all
Find the positions of all strings equal to a given string in a vector of strings. Instead of stopping at the first match, collect all positions. This is in C It'd definitely help if you could explain how you solved it Thanks in advance! Find the positions of all strings equal to a given string in a vector of strings. Instead of stopping at the first match, collect all positions. Complete the following file: vectorutil.cpp #include #include using namespace std; Finds the positions of all strings equal to a given string in an array list of strings. @param words a vector of strings @param word the word to search for @return a vector of all matching positions vector findAllconst vector & words, const string& word vector int pos; Submit Testers Running Tester.cpp fail fail pass words how much, wood, would, a wood, chuck, chuck, if a wood, chuck, could, chuck, wood findAllwords "wood": Expected: findAllwordsa: Expected: findAllwords "the": Expected: Score
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
