Question: HandsOn 1 : Periodic String You are given a binary string S , consisting of O ' s and 1 ' s . A string
HandsOn
: Periodic String
You are given a binary string consisting of s and s
A string has period if for all i from to
Your task is to find a string which satisfies the following conditions:
is a subsequence of
T has the smallest period possible.
Note:
denotes the length of string
Input Format
The first line contains a string, denoting the given string.
Constraints
len
Sample Test Cases
Case
Input:
Output:
Explanation:
Given
T can be as it satisfies all of the given conditions.
Case
Input:
Output:
Explanation:
Given
T can be as it satisfies all of the given conditions.
Case
Input:
Output:
Explanation:
Given
T can be as it satisfies all of the given conditions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
