<ul data-eligibleForWebStory="true">Alice is trying to type a specific string on her computer but may press a key for too long resulting in duplicate characters.The task is to determine the total number of possible original strings that Alice might have intended to type.For each contiguous run of characters in the input string, there are L-1 possible original strings, where L is the length of the run.The algorithm processes each character in the string once, with a time complexity of O(n) and space complexity of O(1).