*Code*
import re
import random

def missing_number(k, N):
    if not (1 < int(N) < 10**100) or '4' not in N:
        #print() should I uncomment this?
        return
    pos = [i.start(0) for i in re.finditer('4', N)]
    inter_list = [i for i in N]
    for i in pos:
        inter_list[i] = str(random.randint(1, 3))
    val = int(''.join(inter_list))
    diff = int(N) - val
    print(f'Case #{k+1}:', diff, val)

t = int(input())
l = [input() for i in range(t)]
    
for t, N in enumerate(l):
    missing_number(t, N)

*Output*






*314146918736982756982374989812764914358762481Case #1: 20 121Case #2: 
200000000000000000020000000020 269187369827569823729898127629Case #3: 
3000000200 11358762281*
On Thursday, April 2, 2020 at 9:30:20 AM UTC+5:30, venkata rajesh 
thotapalli wrote:
>
> Send your code
>
> On Wed, Apr 1, 2020, 9:39 PM Nikhil Kumar vats <[email protected]> 
> wrote:
>
>> Here is the code, 
>> https://pastebin.com/mU2A5pd <https://pastebin.com/mU2A5pdS>S
>>
>> It is working fine, in my local system but while submitting online in 
>> codejam IDE, I am getting runtime, for  even give below set of input,
>>
>> Input:
>> 1
>> 940
>>
>> Can you please help why its giving RE?
>>
>>
>>
>>
>> -- 
>> 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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-code/dd7d85b0-bbe6-41f7-96f8-8ae2254dffe5%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-code/dd7d85b0-bbe6-41f7-96f8-8ae2254dffe5%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>


On Thursday, April 2, 2020 at 9:30:20 AM UTC+5:30, venkata rajesh 
thotapalli wrote:
>
> Send your code
>
> On Wed, Apr 1, 2020, 9:39 PM Nikhil Kumar vats <[email protected] 
> <javascript:>> wrote:
>
>> Here is the code, 
>> https://pastebin.com/mU2A5pd <https://pastebin.com/mU2A5pdS>S
>>
>> It is working fine, in my local system but while submitting online in 
>> codejam IDE, I am getting runtime, for  even give below set of input,
>>
>> Input:
>> 1
>> 940
>>
>> Can you please help why its giving RE?
>>
>>
>>
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-code/dd7d85b0-bbe6-41f7-96f8-8ae2254dffe5%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-code/dd7d85b0-bbe6-41f7-96f8-8ae2254dffe5%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/de079d75-c1a9-4b9e-af78-366ef6e7eea2%40googlegroups.com.

Reply via email to