Given a string s containing 0's and 1's. You have to return a smallest positive integer C, such that the binary string can be cut into C pieces and each piece should be of the power of 5 with no leading zeros.
The first line of the input contains T denoting the number of test cases. For each test case, there is a string s.
For each test case, the output is an integer C. If no such cuts are possible then return -1.
Note: The string s is a binary string.
1.We can split the given string into three “101”s, where 101 is the binary representation of 5.
2."1111101 " is 125 which is 5^3.
3.0 is not a power of 5.
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.