Company: Capital One_1july
Difficulty: medium
Typing Key Changes Problem Description You are given an array of uppercase and lowercase English letters, recording , representing the sequence of letters a user typed. Determine how many times the user switched physical keys while typing this sequence. Uppercase and lowercase versions of the same letter share a single physical key (Shift and Caps Lock are ignored when deciding this), so typing 'W' followed by 'w' does not count as a key switch, while typing 'w' followed by 'e', or 'W' followed by 'E', does. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(recording.length) will fit within the execution time limit. Examples Example 1: Input: recording = ['w', 'W', 'a', 'A', 'b', 'B'] Output: solution(recording) = 2 Explanation: 'W' and 'w' both map to the physical key 'w'. 'A' and 'a' both map to the physical key 'a'. 'B' and 'b' both map to the physical key 'b'. The sequence of physical keys pressed is 'w' -> 'a' ->