Forgot password



what will be the output if input string equal to . or 0.0


Password string cannot will be never be equal to . as it is specified in the question that it is a decimal number.


““After all the character replacements, the string is guaranteed to be a decimal number””
So, S cannot be ‘.’


But what if the input string is .000000 and does not have any integer part,

after removing the unwanted zeros and the decimal point the answer will be blank, so can the answer be empty? or do we still print ‘0’?


Just to reiterate the problem statement for you, The password is always the shortest notation. Hence 0.0 in decimal ~ 0 in whole number. Think like that for all cases.