12345678910111213 |
- /* Create a function that counts the number of times a
- * particular letter shows up in the word search.
- */
- using namespace std;
- int letterCounter(vector<vector<char>> arr, char c) {
- int mycount = 0;
- // loop over the array to get the count of each character array
- for (int i=0;arr.size()>i;i++){
- // add the count of "c" to count
- mycount += count(arr[i].begin(),arr[i].end(), c);
- }
- return mycount;
- }
|