Number of Strings That Appear as Substrings in Word

PHOTO EMBED

Sat Oct 08 2022 16:42:21 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    int numOfStrings(vector<string>& patterns, string word) {
        int c=0;
        for(int i=0;i<patterns.size();i++)
        {
            if(word.find(patterns[i])!=-1) c++;
        }
        return c;
    }
};
content_copyCOPY

Do it again

https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word/