Question: Problem stotement You are given a binary string ' S ' , i . e . ' Stj ' ' is either ' 0 '
Problem stotement
You are given a binary string S ieStjis either or For this task, you are
asked to retum the sum of the length of all the substring which contains an odd
number of :
For Exomple:
Here, the substrings with an odd number of s are
and
Therefore, we retum for the given example.
Detoiled explongition Inputoutput format, Notes, Images
Constuints:
Slength
ime Limit second
Sample Input :
Sample Outout :
Sample Input is
Sample output :
Explanation :
All the substrings with odd numbers of s are
and Therefore the sum of length will be
Hence we return
Sample Input :
Sample output :
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
