Function to find the periodic string with minimum period
def findPeriodicString ( S ) : NEW_LINE INDENT l = 2 * len ( S ) NEW_LINE count = 0 NEW_LINE for i in range ( len ( S ) ) : NEW_LINE INDENT if ( S [ i ] == '1' ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT DEDENT DEDENT