clarification in question [forgot passward]

is it possible that S evaluates to “.” or “.000000” after applying the rules?
can the output be a negative decimal number(after applying the rules).?

1 Like

No ! it’s clearly mentioned that

“After all the character replacements, the string is guaranteed to be a decimal number”


No its not possible.

if this happens , I think u should output 0 for it
but as achaitanyasal said that I will be a decimal number
but if there are extra prefix 0s then it also has very slight possibility of ur case being existing in the test cases

@achaitanyasai: What happens after all the character replacements the string is 0000.0000 ? What will be the shortest notation of this string? 0 or 0000 or no change or something else?


ans for 000.000 should be 0.
for 0 it should be 0.
.000 shouldn’t be a testcase.
correct me if i m wrong.

No, after decrypting, the string is ensured to be a decimal number,
Its one of those problems which are really easy, but is quite tricky to implement because of some corner cases!