#211. 递归统计字符'x'数量

    ID: 211 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatWarmup-2gesp5递归

递归统计字符'x'数量

Count 'x' Recursively

Background

Congcong is currently learning string manipulation. He encountered an interesting problem that requires him to solve it using recursion.

Problem Description

Given a string, compute recursively (no loops) the number of lowercase 'x' chars in the string.

Input Format

Input is given from standard input in the following format.

ss

Output Format

Output is printed to standard output in the following format.

countcount

Sample

xxhixx
4
xhixhix
3
hi
0

Sample Explanation

For the first sample xxhixx, there are 4 lowercase 'x' characters in the string. For the second sample xhixhix, there are 3 lowercase 'x' characters in the string. For the third sample hi, there are no lowercase 'x' characters in the string.

Constraints

Time limit: 1 second per test case. Memory limit: 1024 KiB per test case.