Get Mystery Box with random crypto!

INFOSYS&WIPRO&COGNIZANT&ACCENTURE &TCS& ALL OFF CAMPUS exam answers group

Logo of telegram channel placementupdatess — INFOSYS&WIPRO&COGNIZANT&ACCENTURE &TCS& ALL OFF CAMPUS exam answers group I
Logo of telegram channel placementupdatess — INFOSYS&WIPRO&COGNIZANT&ACCENTURE &TCS& ALL OFF CAMPUS exam answers group
Channel address: @placementupdatess
Categories: Education
Language: English
Subscribers: 2.24K

Ratings & Reviews

2.67

3 reviews

Reviews can be left only by registered users. All reviews are moderated by admins.

5 stars

0

4 stars

1

3 stars

0

2 stars

2

1 stars

0


The latest Messages 8

2022-04-24 12:58:37
274 views09:58
Open / Comment
2022-04-24 08:31:26 INFOSYS&WIPRO&COGNIZANT&ACCENTURE &TCS& ALL OFF CAMPUS exam answers group pinned «https://t.me/+Vzv3LvUHsgnxExvP Our discussion chanel»
05:31
Open / Comment
2022-04-24 08:31:05 https://t.me/+Vzv3LvUHsgnxExvP

Our discussion chanel
448 viewsedited  05:31
Open / Comment
2022-04-24 08:29:46 int ans = 0;
for(int i = 0; i < N; ){
int num = A.get(i);
int j;
for(j = 0; j < N; j++){
if(i == j)
continue;
if(num % A.get(j) == 0)
break;
}
if(j == N)
ans++;
i++;
}
return ans;

Java
ANOTHER DIVISOR PROBLEM Code
Telegram - @placementupdatess
465 views05:29
Open / Comment
2022-04-24 08:29:10 class Solution:
def countSubstrings(self, s: str) -> int:
n = len(s)
c=0
for i in range(0,n-1): #i=0
print('i:',i)
for j in range(i+1,n+1): #j=1
print('j',j)
temp = s[i:j]
if len(temp) == 1:
c+=1
# if the len of substring is even,
# check if the reverse of the string is same as the string
elif(len(temp)%2 == 0):
if (temp == temp[::-1]):
c+=1
print("c",c)
else:
# create a dict to check how many times
# each value has occurred
d = {}
for l in range(len(temp)):
if temp[l] in d:
d[temp[l]] = d[temp[l]]+1
else:
d[temp[l]] = 1
print(d)

return c


op = Solution()
op.countSubstrings('aabb')

Python



Wedding code
432 views05:29
Open / Comment
2022-04-24 08:27:42 x=[]
for i in range(N):
x.append(1)
a=1 examcell
while(a for i in range(a,N,a+1):
x[i]=x[i]+1
a=a+1
print(x.count(K))

Python
Performing strange task codde

@placementupdatess
406 views05:27
Open / Comment
2022-04-24 08:11:37 Flip Or Swap


def flip( ch):
return '1' if (ch == '0') else '0'

# Utility method to get minimum flips when
# alternate string starts with expected char
def getFlipWithStartingCharcter(str, expected):

flipCount = 0
for i in range(len( str)):

# if current character is not expected,
# increase flip count
if (str[i] != expected):
flipCount += 1

# flip expected character each time
expected = flip(expected)
return flipCount

# method return minimum flip to make binary
# string alternate
def minFlipToMakeStringAlternate(str):

# return minimum of following two
# 1) flips when alternate string starts with 0
# 2) flips when alternate string starts with 1
return min(getFlipWithStartingCharcter(str, '0'),
getFlipWithStartingCharcter(str, '1'))

# Driver code to test above method
if name == "main":

str = "0001010111"
print(minFlipToMakeStringAlternate)

Python flip or …
454 views05:11
Open / Comment
2022-04-24 08:10:56 #include
using namespace std;
class gas {
public:
int gas;
int distance;
};
int findStartIndex(gas stationQueue[], int n) {
int start_point = 0;
int end_point = 1;
int curr_gas = stationQueue [start_point].gas - stationQueue [start_point].distance;
while (end_point != start_point || curr_gas < 0) {
while (curr_gas < 0 && start_point != end_point) {
curr_gas -= stationQueue[start_point].gas - stationQueue [start_point].distance;
start_point = (start_point + 1) % n;
if (start_point == 0)
return -1;
}
curr_gas += stationQueue[end_point].gas - stationQueue [end_point].distance;
end_point = (end_point + 1) % n;
}
return start_point;
}
int main() {
gas gasArray[] = {{4, 6}, {6, 5}, {7, 3}, {4, 5}};
int n = sizeof(gasArray)/sizeof(gasArray [0]);
int start = findStartIndex(gasArray, n);
if(start == -1)
cout<<"No solution";
else
cout<<"Index of first gas station : "<}

C++
GAS STATION Code
431 views05:10
Open / Comment
2022-04-24 08:10:12 // Java program to find the XOR of
// all elements in the array
class GFG {

// Function to find the XOR of
// all elements in the array
static int xorOfArray(int arr[], int n)
{
// Resultant variable
int xor_arr = 0;

// Iterating through every element in
// the array
for (int i = 0; i < n; i++) {

// Find XOR with the result
xor_arr = xor_arr ^ arr[i];
}

// Return the XOR
return xor_arr;
}

// Driver Code
public static void main (String[] args)
{

int arr[] = { 3, 9, 12, 13, 15 };
int n = arr.length;

// Function call
System.out.println(xorOfArray(arr, n));

}
}

Java

Prefix XOR
434 views05:10
Open / Comment
2022-04-24 08:09:46 #include
using namespace std;
#define ll long long

ll qdSum(ll n){

if (n==0){
return 0;
}

return ((n%10)*(n%10)*(n%10)*(n%10)) + qdSum(n/10);
}



ll getProduct(ll n){
// Base Case
if(n == 0){
return 1 ;
}

// get the last digit and multiply it with remaining digits
return (n%10) * getProduct(n/10) ;
}



ll gcd(ll a, ll b)
{
return b == 0 ? a : gcd(b, a % b);
}



bool isSpecial(ll N){
if(gcd(qdSum(N),getProduct(N)) > 1){
return 1;
}
return 0;
}


int main() {


int T;
cin>>T;

while(T--){

ll N;
cin>>N;
int count=0;
while(N != 1){

if(isSpecial(N)){
count++;
}
N--;
}
cout<

}


}
C++

Primo numbers in the Array
450 views05:09
Open / Comment