TCS CodeVita: Last Minute Preparation Strategy | Season 11

TCS CodeVita: Last Minute Preparation Strategy | Season 11

Prep Insta

8 месяцев назад

8,312 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Shivam Goswami
Shivam Goswami - 23.11.2023 19:09

Sir how to submit the code i am not understood that how to submit the code?

Ответить
Rajulagari Nikhitha
Rajulagari Nikhitha - 23.11.2023 14:30

def pp(d,l,c,o):
c=c+1
sd={i:j for i,j in sorted(d.items(),key=lambda x:x[1])}
p=0
for i,j in sd.items():
sd[i]=l[p]
p=p+1
if sd==o:
print(c)
else:
pp(sd,l,c,o)

n=int(input())
l=list(map(int,input().split()))
d={}
s=97
c=0
for i in range(n):
d[chr(s)]=l[i]
s=s+1
o=d
r=pp(d,l,c,o)
print(r)

Ответить
Veluru Hareesh
Veluru Hareesh - 23.11.2023 05:27

Is the exam is offline or online

Ответить
Maltova
Maltova - 22.11.2023 17:46

Solution for Grooving monkey irrespective of Time and Space:

N = 6
arr = [3,6,5,4,1,2]
start=ord('a')
hashmap={}
for i in range(N):
hashmap[chr(start)]=arr[i]
start+=1
ans=hashmap.copy()
cnt=0
while True:
cnt+=1
sorted_dict = {k: v for k, v in sorted(hashmap.items(), key=lambda item: item[1])}
hashmap=sorted_dict
minicnt=0
for x in hashmap.keys():
hashmap[x]=arr[minicnt]
minicnt+=1
ancnt=0
for key in ans:
try:
if ans[key]==hashmap[key]:
ancnt+=1
except:
continue
if ancnt==N:
print(cnt)
print(hashmap)
print(ans)
break
else:
continue

Ответить
Priyanka
Priyanka - 22.11.2023 16:56

Sir how can I submit my coding

Ответить
swetank dubey
swetank dubey - 22.11.2023 16:40

Sir i registered my self for code-vita and i got mock test emails but i didn't recieve recent test details from tcs? Explain?

Ответить