Tough TCS Codevita: Zone 2

Bhai , please send me the link to their official Site :sweat_smile: and also the link to register for upcoming contest , Really I am not able to find the link and register for them

But It was not sowing at the time of contest also.I thought it will show after contest gets over.

Sample test of Count palindromes were wrong?
I am pretty sure my brute force was correct.
.

4 Likes

you’re damn correct. Waste my 6hrs for shitty problem set.

1 Like

Were you able to crack it?

obviously not their test cases were wrong, I guess.

I was able to solve only 7x7
and other 3 problem I wrote code for were giving WA

2 Likes

Same here solved only one question. Lets hope we qualify.

I don’t know what is happening in string pair

5 Likes

I was able to solve one question tha string pair
Got presentation error in public test case and TLE in private any chance of round 2 for me? :pleading_face:

Yes what i did is -

def ispali(s):
    r = s[::-1]
    return (r==s)

cnt=0

st , en = map(int,input().split(' '))
for i in range(st,en+1):
    s1 = str(i)
    for hr in range(0,24):
      s2 = (2-len(str(hr)))*'0' + str(hr)
      for mini in range(0,60):
          s3 = (2-len(str(mini)))*'0' + str(mini)
          for sec in range(0,60):
              s4 = (2-len(str(sec)))*'0' + str(sec)
              if(ispali(s1+s2+s3+s4)):
                  cnt+=1

print(cnt)

#approach 2

cnt=0
for i in range(st,en+1):
    for j in range(0,86400):
        x = j
        hr = x//3600
        x = x%3600
        mini = x//60
        x = x%60
        sec = x%60
        
        s2 = (2-len(str(hr)))*'0' + str(hr)
        s3 = (2-len(str(mini)))*'0' + str(mini)
        s4 = (2-len(str(sec)))*'0' + str(sec)
        
        if(ispali(str(i) + s2+s3+s4)):
            cnt+=1
print(cnt)


#both give same answer for
# 1 2 
# 288
1 Like

Yes I too wasted my 2 hrs trying to figure out where i went wrong

288 was coming for 1 sample, no?

Yes and 432

yes likha to .

Had anyone got “Unlocker” problem?

4 Likes

Anyone solved any of these questions? Please share your approach
Count palindrome
Even odd
Moving average
Tennis Score
subnetting
String merge.

Why kind of peps are working at TCS?
Or I misunderstood the question?

Do they give partial marking for not passing all the test cases??

Many people has share ss of graph in tcscodevita contest,
from where they get the graph and after what time ending of zone 1

Did you get all these problems in your problem set?