Question
Decode characters
You're given a code containing some ". " and "- ".
Digit 0 is transmitted as ".", 1 as "-." and 2 as "--" (ignore quotes, `" "`). You are to decode the given code,
i. e. to find out the number given its representation in the above decoding alphabet.
Note: The test cases are designed such that each input will have a unique and valid decoding based on the given rules.
Digit 0 is transmitted as ".", 1 as "-." and 2 as "--" (ignore quotes, `" "`). You are to decode the given code,
i. e. to find out the number given its representation in the above decoding alphabet.
Note: The test cases are designed such that each input will have a unique and valid decoding based on the given rules.
Input
Given a string s, representing the code. ( 1 <= |s| <= 105)
Output
Print the decoded value.
Example
Sample Input
--.
Sample Output
20
Explanation
"-- " = 2
"." = 0
Hence, 20.
--.
Sample Output
20
Explanation
"-- " = 2
"." = 0
Hence, 20.