Easy
Click Counter
Write a
Counter class with click() (adds 1), reset() and a value attribute. Read a string of commands like ccrcc (c = click, r = reset) and print the final value.Input
One line of c and r characters.
Output
The value.
Sample 1
Input
ccrcc
Output
2
Sample 2
Input
cccc
Output
4
Output appears here