Last active
August 29, 2015 14:15
-
-
Save ik11235/7642fbf7be3ee2ec62ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaroFillingAStringDiv2 { | |
public: | |
int getNumber(string S) { | |
if(S.size()<2) | |
return 0; | |
int ans=0; | |
int i=0; | |
while(S[i]=='?') | |
i++; | |
for (; i < s.size(); i++) { | |
if(S[i]=='?') | |
{ | |
if(S[i-1]=='A') | |
S[i]=='B'; | |
else | |
S[i]=='A'; | |
} | |
if(s[i-1]==s[i]) | |
ans++; | |
} | |
return ans; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment