50 cases Time limit 1000 ms total Memory 256 MB
A row of seats is written as a string: . is a free seat and X is a taken one. A
couple wants to sit in two free seats right next to each other.
Return the number of different pairs of seats they could choose.
Constraints:
len(s) ≤ 40s contains only . and XExamples:
f("..X...") returns 3 (one pair on the left, two on the right)
f("....") returns 3
f(".X.X.") returns 0
f("") returns 0
["..X..."]
3
[""]
0
["...."]
3
[".X.X."]
0