C++ || O(n) || Explanation || Easy
Approach\n1) First we check if the size of the words vector is equal to the string s traget if not then s cannot be the acronym of words so we return false. \n\
# Approach\n1) First we check if the size of the words vector is equal to the string s traget if not then s cannot be the acronym of words so we return false. \n\n2) Then we use to loop to check if the 0th index of every element in words is equal to the ith character in the s. if not we return false.\n\n 3) At the end we return true since the loop doesn\'t break this means s is the acronym of the word\n\n# Complexity\n- Time complexity:\nThe time complexity of this code is **O(n)**.\n- Space complexity:\nThe space complexity of this code is **O(1)**, which is constant space.\n\n# Code\n```\nclass Solution {\npublic:\n    bool isAcronym(vector<string>& words, string s) {\n        if(size(words) != size(s)){\n            return false;\n        }\n\n        for(int i = 0; i < size(words); i++){\n            if(words[i][0] != s[i]){\n                return false;\n            }\n        }\n        return true;\n    }\n};\n```
['C++']