using namespace std ;
string s ;
int size = s.size();
int arr[size] ;
int count = 0 ;
for(int i = size-1 ; i>=0 ; i--)
if(s[i]%2 == 0)
arr[i]= count ;
for(int i =0 ; i<size ; i++)
- Problem Description
Soumika has a string S and its starting index is 1. The string S consists of characters from 19. As she is very intelligent, she wants to test his brother Vinay Tendulkar.
She asked her brother Vinay Tendulkar to count the number of even numbered characters ( i.e 2,4,6,8 ) for every index
(1<=i<=|S|). For an index i, the result should be calculated from i to the end of the string. As Vinay doesn’t know about programming, he wants you to help him find the solution.
First line contains a string S.
Print |S| space-separated integers,the result of every index.
1<= |S| <= 10^4
- Test Case 1
Expected Output5 5 5 4 3 3 2 2 1
- Test Case 2
Expected Output5 5 4 4 3 2 2 1 1 1 0