Company: Paypal_25dec
Difficulty: medium
Count Key Changes You are given an array of uppercase and lowercase English letters recording representing a sequence of letters typed by the user. Your task is to count the number of times that the user changed keys while typing the sequence, considering that the uppercase and lowercase letters for a given letter require the user to press the same letter key (ignoring modifiers like Shift or Caps Lock). For example, typing 'W' and 'w' require the user to press the same key, whereas typing 'w' and 'e' or typing 'W' and 'e' require the user to change keys. 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. Example 1 Input: recording = ['W', 'w', 'a', 'A', 'a', 'b', 'B'] Output: 2 Explanation: - Typing 'W' and 'w' require the same key 'w'. - Typing 'A' and 'a' require the same key 'a'. - Typing 'B' and 'b' require the same key 'b'. So, the user changed keys in