You are given a string S of length N consisting of characters '0' or '1'.
Ben likes substrings and he can choose any substrings from S. A substring is a contiguous sequence of characters within a string. However, he can only choose a substring if the substring he selects starts with '1' and the equivalent decimal value of the binary substring lies between L and R inclusive.
You need to find out the number of ways in which Ben can choose a substring from the given string.
Answers
Answered by
0
Explanation:
hfjyvydindkjdbdjsnfjdbdjd book svjsych&37£-8£;£92()#:_8_;_+£9#)
Answered by
0
Given a string ‘str’, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together.
Examples:
Input: str = "abcabcabc"
Output: true
The given string is 3 times repetition of "abc"
Input: str = "abadabad"
Output: true
The given string is 2 times repetition of "abad"
Input: str = "aabaabaabaab"
Output: true
The given string is 4 times repetition of "aab"
Input: str = "abcdabc"
Output: false
Similar questions