You are given a binary string s indexed from
s[i] = '0' denotes that the
s[i] = '1' denotes that the
You want to select s.length such that the selected sequence of characters forms either '010' or '101'.
Return the total number of valid ways to select
Constraints:
s.length
s[i] is either '0' or '1'.
You are given a binary string s indexed from
s[i] = '0' denotes that the
s[i] = '1' denotes that the
You want to select s.length such that the selected sequence of characters forms either '010' or '101'.
Return the total number of valid ways to select
Constraints:
s.length
s[i] is either '0' or '1'.