Given a string 's', your task is to complete the function checkString which returns true if it is possible to convert 's' to a string that is repetition of a substring with 'k' characters else returns false, where in order to convert we can replace one substring of length k with k characters.
Input: str = "abcbedabcabc", k = 3 Output: 1 Replace "bed" with "abc" so that the whole string becomes repetition of "abc". Input: str = "bcacbcac", k = 2 Output: 0
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains 2 lines. The first line of each test case contains a string s. The second line of each test case contains an integer n.
For each test case in a new line output will be 1 if it is possible to convert the string else 0.
1< |Length of string| <=100
Example(To be used only for expected output):
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.