Key Changes Count
You're given a string s typed by a user. A change of key occurs when the user switches to a different key from the last used key. For example, in the string "ab", switching from 'a' to 'b' is considered a change of key, while in "bBBb", there are no key changes.
Count and print the number of times the user had to change the key while typing the string s.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)