diff --git a/3330. Find the Original Typed String I b/3330. Find the Original Typed String I new file mode 100644 index 0000000..28ba92d --- /dev/null +++ b/3330. Find the Original Typed String I @@ -0,0 +1,19 @@ +class Solution { +public: + int possibleStringCount(string word) { + int count = 1; + int result = 0; + + for (int i = 1; i < word.size(); i++) { + if (word[i] == word[i - 1]) { + count++; + } else { + result += (count - 1); + count = 1; + } + } + + result += (count - 1); + return result + 1; + } +};