Company: Visa_17sep
Difficulty: medium
Words with Matching Start and End Characters Problem Description Imagine you are developing a tool for authors that helps them analyze their writing patterns to enhance consistency. One feature of this tool involves examining the structure of words within a text. You are given a string text that represents a sequence of words consisting of English letters (both uppercase and lowercase) separated by spaces. Your task is to find all words in the string that start and end with the same letter, considering that the letter may appear in different cases (e.g., a word may start with an "a" and end with an "A"). Return the number of such words as an integer. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(text.length) will fit within the execution time limit. The problem expects you to implement the following function: int solution(string text) { } Examples Example 1: Input: text = "Level dEmaND nonE" Output: 2 Explanation: