Input "" should return 1 instead of 0


The task is
Given an encoded message containing digits, determine the total number of ways to decode it.
So the input string MUST BE a valid encoded message. Otherwise the task could be formulated like this:
Given a string (containing digits), determine the total number of ways to decode it, or return 0 if it is not a valid encoded message.

@YongHaoHu We can say the only way to decode "" is "" (just like the only way to decode "51" is "51" and the only two ways to decode "171" are "171" and "171"). So I agree that returning 1 instead of 0 would be more logically and mathematically consistent.