Thanks for the help. But, I figured out the problem and fixed my code and
resubmitted it and it passed all the test cases.

On Wed, Mar 3, 2021 at 3:26 AM porker2008 <zhangxion...@gmail.com> wrote:

> Hi,
>
> I can give you some input that your solution will fails to handle
>
> try
> *221*
>
> your code produce *219*, which is not a tidy number
>
> 在2021年3月2日星期二 UTC-8 上午8:18:15<sowm...@gmail.com> 写道:
>
>> Hello,
>>
>> I am repeatedly getting WA for Test Set - 1 on submitting my code. (Note:
>> Sample test data input produces the expected output)
>> But when I tried to simulate the Test Set 1 by entering the inputs
>> manually with “Test run mode” on , there was no issue. I am unable to debug
>> any further because there is no further description apart from WA.
>>
>> *I am stuck.Any help is appreciated.*
>>
>> Below is my code in Python:
>>
>> T=int(input())
>>
>>
>> def tidy(num):
>>   l=len(num)
>>   sNum = set(num)
>>   tSet = {'1','0'}
>>   if len(sNum) == 1:
>>       return num
>>   elif int(num[0]) == 9:
>>       return "8"+(l-1)*"9"
>>   elif sNum == tSet:
>>       return "9"*(l-1)
>>   else:
>>       t=""
>>       for i in range(0,l):
>>           iN = int(num[i])
>>           if iN > int(num[i+1]):
>>               if iN-1 != 0:
>>                   t = t + str(iN-1)
>>               return (t + "9" * (l-i-1))
>>           else:
>>               t = t+num[i]
>>
>>           if i == l - 2:
>>               break
>>       return num
>>
>>
>> for i in range(T):
>>   num = input()
>>   print("Case #{}: {}".format(i+1, tidy(num)))
>>
>> Thanks
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/5d9216cc-194b-4f00-a095-c4f14ea9232dn%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/5d9216cc-194b-4f00-a095-c4f14ea9232dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAF%3D3CMp0C6XX4hKO0suRG84TDH95C1EDEWdknP49TFuRk5qTFg%40mail.gmail.com.

Reply via email to