Adjacent Character Removal
Oracle interview questions · Easy · Coding round · 6 tests
Given a lowercase string word, you may replace any one character with any other lowercase letter in a single operation. Return the minimum number of replacements needed so that no two adjacent characters in the final string are identical.
Function signature
minimumAdjacentReplacements(word: string): numberRun your code with Ctrl+Enter to see results.