Java | 1 liner | Explained
Approach\n size(s) must be the same as size(words) for s to be an acronym\n Use a pointer to check if the first letter of current word equals the current letter
# Approach\n* size(s) must be the same as size(words) for s to be an acronym\n* Use a pointer to check if the first letter of current word equals the current letter of s\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n), where n = size(s)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\npublic boolean isAcronym(List<String> words, String s) {\n    if (s.length() != words.size())\n        return false;\n    \n    for (var i = 0; i < s.length(); i++)\n        if (s.charAt(i) != words.get(i).charAt(0))\n            return false;\n    \n    return true;\n}\n```\n**Variation 2:** 1 liner using streams\n```\npublic boolean isAcronym(List<String> words, String s) {\n    return s.length() == words.size() \n        && IntStream.range(0, s.length())\n                    .noneMatch(i -> s.charAt(i) != words.get(i).charAt(0));\n}\n```\n***Please upvote if this helps***
['Java']