#3330

Find the Original Typed String I

newbie · 275 · lc easy +19 · 72.1% accepted · 525 likes · top 81%

Description

Alice is trying to type a specific string but she sometimes holds a key too long, causing a character to repeat.

She believes she made this mistake at most once.

You are given a string word representing what ended up on Alice's screen.

Return the total number of distinct original strings Alice might have been intending to type.

Code

1
2
3