Off Campus Job Update
6.52K subscribers
313 photos
3 videos
22 files
968 links
500+ Placement & Competitive Exam Materials
75+ Companies Materials
100+ JOB Updates in a Month

πŸš€DM for Promotion @Wren_0
πŸš€Placement Updates: @offcampusjobs_0
🌟 Placment Material: @placement_materials0
Download Telegram
def check(a,n)

if n==1:

       return 1

     a.sort()

     c=0

     i=0

     while(i<n-1):

            if a[i+1]-a[i]==1:

                  i=i+2

                  c=c+1

           else:

                  i=i+1

      if c:

            return c

      else:

            return 1

n=int(input())

a=[]

for i in range(n):

      a.append(int(input()))

print(check(a,n))

Python
Whales code
Telegram -
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0.
http://t.me/Coding_solution_0
def minOps(A, B):
m = len(A)
n = len(B)

# This part checks whether conversion is possible or not
if n != m:
return -1

count = [0] * 256

for i in range(n): # count characters in A
count[ord(B[i])] += 1
for i in range(n): # subtract count for every char in B
count[ord(A[i])] -= 1
for i in range(256): # Check if all counts become 0
if count[i]:
return -1

# This part calculates the number of operations required
res = 0
i = n-1
j = n-1
while i >= 0:

# if there is a mismatch, then keep incrementing
# result 'res' until B[j] is not found in A[0..i]
while i>= 0 and A[i] != B[j]:
i -= 1
res += 1

# if A[i] and B[j] match
if i >= 0:
i -= 1
j -= 1

return res

# Driver program
A = "EACBD"
B = "EABCD"
print ("Minimum number of operations required is " + str(minOps(A,B)))


Python
Minimum number of operations required Code
βœ…
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
def minOps(A, B):
m = len(A)
n = len(B)

# This part checks whether conversion is possible or not
if n != m:in
return -1

count = [0] * 256

for i in range(n): # count characters in A
count[ord(B[i])] += 1
for i in range(n): # subtract count for every char in B
count[ord(A[i])] -= 1
for i in range(256): # Check if all counts become 0
if count[i]:
return -1

# This part calculates the number of operations required
res = 0
i = n-1
j = n-1
while i >= 0:

# if there is a mismatch, then keep incrementing
# result 'res' until B[j] is not found in A[0..i]
while i>= 0 and A[i] != B[j]:
i -= 1
res += 1

# if A[i] and B[j] match
if i >= 0:
i -= 1
j -= 1

return res

# Driver program
A = "EACBD"
B = "EABCD"
print ("Minimum number of operations required is " + str(minOps(A,B)))

βœ…Telegram- Send the Question here β€οΈπŸš€
https://t.me/good_coders
https://t.me/good_coders
https://t.me/good_coders
Channel name was changed to Β«TCS NQT Infosys Exam SOLUTION / ALL EXAM SOLUTIONΒ»
#include<bits/stdc++.h>
using namespace std;

int main(){
int n ;
cin>>n;
vector<int>a(n);
vector<int>b(n);
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
int ans=1;
for(int i=0;i<n;i++)
{
int temp=1;
for(int j=i+1;j<n;j++)
{
if((a[i]>=a[j] && a[i]<=b[j]) || (a[j]>=a[i] && a[j]<=b[i] ))
temp++;
}
ans= max(ans,temp);
}
cout<<ans;
return 0;
}


Python
Courth house Codeβœ…βœ…
Telegram
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
N =int(input())
L = [int(i) for i in input().split()]
S=sum(L)
moves=0
If S%N!=0:
Print( -1)
else:
x=S//N
for i in range(len(L)):
L[i] = L[i] - x
Print(max(L))

Python
1st Qsn
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
http://t.me/Coding_solution_0
Channel name was changed to Β«TCS NQT Revature Infosys Exam SOLUTION / ALL EXAM SOLUTIONΒ»
TCS Verbal
-------------------

1) take to his books blow steam
2)bend over. Backwards
3)cut her some slak
4)powdery snow
5)effected
6) Modulate
7)Swindle
8)Full
9)commend
10)confiscate
11)Withdrawn
12)involved
13) obliterated
14)Obviates
15)BDAC
16)DACB
17)detained
18)consicous about
19)RP
20)RQ
21)The history of
22)Paris
23)Boulangers
24)Each member must sent a
βœ…
http://t.me/Coding_solution_0
TCS REASONING
1)113
2)222
3)14
4)607
5)42
6)143
7)

βœ…Telegram- http://t.me/Coding_solution_0
http://t.me/Coding_solution_0