Intelligent Girl
Practice
3.3 (1040 votes)
Ad Hoc
Easy
Implementation
Problem
89% Success 26880 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Soumika has a string S and its starting index is 1. The string S consists of characters from \(1-9\). 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 i \( (1 \le i \le | 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.
Input:
First line contains a string S.
Output:
Print |S| space-separated integers,the result of every index.
Constraints:
1 ≤ |S| ≤ \(10\)4
Submissions
Please login to view your submissions
Similar Problems
Points:20
66 votes
Tags:
AlgorithmsApprovedDynamic ProgrammingEasyOpen
Points:30
330 votes
Tags:
ApprovedEasyReadySorting
Points:20
126 votes
Tags:
AlgorithmsDynamic ProgrammingEasy
Editorial