TCS NQT exam answer
22 subscribers
6 photos
11 links
Download Telegram
Subscribe Channel for answers https://t.me/nqt_0
For more answers
TCS NQT 2PM- AUGUST 20TH

1) no

2) puma
3. 18010
4. 2
5. Data in both 1 and 2 are necessary
6. Candidates is not to be selected
7. Harsh
8. UBPJDJQU
9 Both A and R is true BUT R is not correct explain of A
10.
Both A and R are true and R is correct explanation of A
Channel name was changed to «TCS NQT exam answer»
N=int(input())
K=int(input())
price=list(map(int,input().split()))
vol=list(map(int,input().split()))
maxvol=0
volu=0
maxvol=max(vol)
for i in range(0,N):
    if (maxvol==vol[i] and price[i]<=K):
        K=K-price[i]
        volu=maxvol
for i in range(0,N):
    for j in range(i+1,N+1):
        if (price[i]<=K and price[i]==price[j]):
            if (vol[i]>vol[j]):
                volu=volu+vol[i]
                K=K-price[i]
            else:
                volu=volu+vol[j]
                K=K-price[j]
        elif (price[i]<=K and price[i]!=price[j]):
            K=K-price[i]
            volu=volu+vol[i]
print(volu)
TCS NQT exam answers lll TCS NQT:
Vijay's Code

Language Python
👎1
Faltu me kisi ko paise na de
Yhi pe saare answers aayenge
Bss wait kre thoda
#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    int arr[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    int count=0;
    int num=arr[0];
    for(int i=1;i<n;i++)
    {
       if(num!=arr[i])
            count++;
    }
    printf("%d",count);
}

C Language
TCS 1st Qsn
Vijays code
Telegram - https://t.me/nqt_0
Vijay's code

C language
2nd question
2nd answer ☝️
Python

Array code
arr=[-1,18,13,18,-2,-16,7,-1,-213,11]
n=len(arr)
maxi=[0]
maxlen=[0]
def fuct(index,s,p):
if index>=n:
if len(p)>maxlen[0]:
maxlen[0]=len(p)
maxi[0]=max(maxi[0],s)
return
else:
if p==[]:
fuct(index+1,s+arr[index],p+[arr[index]])
fuct(index+1,s,p)
else:
if p[-1]>0:
if arr[index]<0:
fuct(index+1,s+arr[index],p+[arr[index]])
else:
fuct(index+1,s,p)
else:
if arr[index]>0:
fuct(index+1,s+arr[index],p+[arr[index]])
else:
fuct(index+1,s,p)
return
fuct(0,0,[])
print(maxi)