You are viewing a single comment's thread. Return to all comments →
// c#
public static int beautifulBinaryString(string b) { string newB = b.Replace("010", "xxx"); int occur = 0; for(int i=0; i<newB.Length; i++) { if (newB.Substring(i,1) == "x") { i += 2; occur++; } } return occur; }
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Binary String
You are viewing a single comment's thread. Return to all comments →
// c#