FORGETPW, June challenge 2014; Ambiguous test case

(reference FORGETPW)

In this problem, For a test case, 0000.000 its clear that the output is 0 bcoz its value =0.

But how does the shortest representation for the test case ‘.’ (decimal point) become 0. Value of a decimal point = 0 ?

Please clarify my doubt

“If the number contains only non-zero fractional part, the integral part should be omitted”

in 0000.000 fractional part is zero,hence integral part which is 0000, cant be omitted…therefore removing unnecessary zeroes in the integral part the answer is 0

1 Like

I know that. But how comes the value of a single decimal point (no zeros in the right or left) = 0 ??

In the editorial, it says that the shortest representation for " . " will be just a single 0

@admin , please help

yes i agree that its a bit confusing but i guess u can make it out yourself for cases like ‘.’ to be 0

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

So according to this, you will never get a string as ‘.’ as it’s not a valid decimal number.

1 Like

Exactly, All the other test cases worked fine. But this case made my code WA

there wasnt any test case consisting only of a single “.”


There wasn’t any test case with the “converted” string ‘.’
However, if you got ‘.’ as the input, there must be a rule accompanying the test case, which specifies what to convert the ‘.’ into.

for eg.




. 9




check “Few tricky test cases” Line 1

hello How to know the failed test cases just like Topcoder and Code cheff

1 Like

@dhyan I don’t know why the writer of editorial wrote about the test case “.”
but to check if there is a test case of “.” , I submitted
and now its 100%sure that the test cases did not have “.”
if “.” test case was there then due to line 35 and 36… i should have got wrong answer

u can do these type of checking yourself also :slight_smile:

PS: author of editorial, problem tester and problem setter are three different coders

1 Like