code.cpp 376 B

12345678910111213
  1. /* Create a function that returns true if an asterisk * is inside a box.
  2. */
  3. #include <algorithm>
  4. bool inBox(std::vector<std::string> arr) {
  5. bool asteriskFound = false;
  6. for(int i=0;i<arr.size();i++){
  7. // search array for "*", if "*" is found return true
  8. if(std::find (arr[i].begin(),arr[i].end(),'*')!=arr[i].end()){
  9. asteriskFound=true;
  10. }
  11. }
  12. return asteriskFound;
  13. }