// Infosys
// N flowers on a Recatangular pana
int ans = 100000000;
void solve(vector<int> a, int n, int k, int index, int sum,
int maxsum)
{
if (k == 1)
{
maxsum = max(maxsum, sum);
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
}
maxsum = max(maxsum, sum);
ans = min(ans, maxsum);
return;
}
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
maxsum = max(maxsum, sum);
solve(a, n, k - 1, i + 1, sum, maxsum);
}
}
int GetMaxBeauty(int N, int K, vector<int> A)
{
solve(A, N, K, 0, 0, 0);
return ans;
}
Telegram:- https://t.me/Coding_human
// N flowers on a Recatangular pana
int ans = 100000000;
void solve(vector<int> a, int n, int k, int index, int sum,
int maxsum)
{
if (k == 1)
{
maxsum = max(maxsum, sum);
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
}
maxsum = max(maxsum, sum);
ans = min(ans, maxsum);
return;
}
sum = 0;
for (int i = index; i < n; i++)
{
sum += a[i];
maxsum = max(maxsum, sum);
solve(a, n, k - 1, i + 1, sum, maxsum);
}
}
int GetMaxBeauty(int N, int K, vector<int> A)
{
solve(A, N, K, 0, 0, 0);
return ans;
}
Telegram:- https://t.me/Coding_human
class CountOccurrences {
public static void main(String[] args) {
String str = "aabbccd";
char a[]=str.toCharArray();
int cnt = 0;
for (int i = 0; i < a.length; i++) {
for (int j = i + 1; j < a.length; j++)
{
if ((a[i] == a[j])) {
cnt++;
}
}
}
System.out.println(cnt);
}
}
Java
Telegram:-https://t.me/Coding_human
public static void main(String[] args) {
String str = "aabbccd";
char a[]=str.toCharArray();
int cnt = 0;
for (int i = 0; i < a.length; i++) {
for (int j = i + 1; j < a.length; j++)
{
if ((a[i] == a[j])) {
cnt++;
}
}
}
System.out.println(cnt);
}
}
Java
Telegram:-https://t.me/Coding_human
Guys ❤️
Infosys Exam on 29/7/22 , 30/7/22,31/07/22
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
Infosys Exam on 29/7/22 , 30/7/22,31/07/22
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
Guys ❤️
Infosys Exam 3 PM Solution
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
Infosys Exam 3 PM Solution
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
def minOperations(arr1, arr2, i, j):
# Base Case
if arr1 == arr2:
return 0
if i >= len(arr1) or j >= len(arr2):
return 0
# If arr[i] < arr[j]
if arr1[i] < arr2[j]:
# Include the current element
return 1 \
+ minOperations(arr1, arr2, i + 1, j + 1)
# Otherwise, excluding the current element
return max(minOperations(arr1, arr2, i, j + 1),
minOperations(arr1, arr2, i + 1, j))
# Function that counts the minimum
# moves required to sort the array
def minOperationsUtil(arr):
https://t.me/Coding_human
brr = sorted(arr);
# If both the arrays are equal
if(arr == brr):
# No moves required
print("0")
# Otherwise
else:
# Print minimum operations required
print(minOperations(arr, brr,)
Python
Q) minimum operations
Telegram - https://t.me/Coding_human
# Base Case
if arr1 == arr2:
return 0
if i >= len(arr1) or j >= len(arr2):
return 0
# If arr[i] < arr[j]
if arr1[i] < arr2[j]:
# Include the current element
return 1 \
+ minOperations(arr1, arr2, i + 1, j + 1)
# Otherwise, excluding the current element
return max(minOperations(arr1, arr2, i, j + 1),
minOperations(arr1, arr2, i + 1, j))
# Function that counts the minimum
# moves required to sort the array
def minOperationsUtil(arr):
https://t.me/Coding_human
brr = sorted(arr);
# If both the arrays are equal
if(arr == brr):
# No moves required
print("0")
# Otherwise
else:
# Print minimum operations required
print(minOperations(arr, brr,)
Python
Q) minimum operations
Telegram - https://t.me/Coding_human
array AR of size N
perfect_sum(arr, s, result) :
x = [0]*len(arr)
j = len(arr) - 1
while (s > 0) :
x[j] = s % 2
s = s // 2
j -= 1
sum = 0
// https://t.me/Coding_human
for i in range(len(arr)) :
if (x[i] == 1) :
sum += arr[i]
if (sum == result) :
print("{",end="");
for i in range(len(arr)) :
if (x[i] == 1) :
print(arr[i],end= ", ");
print("}, ",end="")
def print_subset(arr, K) :
x = pow(2, len(arr))
for i in range(1, x):
perfect_sum(arr, i, K)
# Driver code
arr = [ ]
n = int(input("Enter length of array : "))
s=int(input("Enter sum : "))
for i in range(n):
ele=int(input("Enter element : "))
arr.append(ele)
print_subset(arr, s)
Python
Telegram:-https://t.me/Coding_human
perfect_sum(arr, s, result) :
x = [0]*len(arr)
j = len(arr) - 1
while (s > 0) :
x[j] = s % 2
s = s // 2
j -= 1
sum = 0
// https://t.me/Coding_human
for i in range(len(arr)) :
if (x[i] == 1) :
sum += arr[i]
if (sum == result) :
print("{",end="");
for i in range(len(arr)) :
if (x[i] == 1) :
print(arr[i],end= ", ");
print("}, ",end="")
def print_subset(arr, K) :
x = pow(2, len(arr))
for i in range(1, x):
perfect_sum(arr, i, K)
# Driver code
arr = [ ]
n = int(input("Enter length of array : "))
s=int(input("Enter sum : "))
for i in range(n):
ele=int(input("Enter element : "))
arr.append(ele)
print_subset(arr, s)
Python
Telegram:-https://t.me/Coding_human
# A Naive recursive python program to find minimum of coins
# to make a given change V
import sys
# m is size of coins array (number of different coins)
def minCoins(coins, m, V):
# base case
if (V == 0):
return 0
# Initialize result
res = sys.maxsize
# Try every coin that has smaller value than V
for i in range(0, m):
if (coins[i] <= V):
sub_res = minCoins(coins, m, V-coins[i])
# Check for INT_MAX to avoid overflow and see if
# result can minimized
if (sub_res != sys.maxsize and sub_res + 1 < res):
res = sub_res + 1
// https://t.me/Coding_human
return res
# Driver program to test above function
coins = [9, 6, 5, 1]
m = len(coins)
V = 11
print("Minimum coins required is",minCoins(coins, m, V))
Python 3
Telegram:- https://t.me/Coding_human
# to make a given change V
import sys
# m is size of coins array (number of different coins)
def minCoins(coins, m, V):
# base case
if (V == 0):
return 0
# Initialize result
res = sys.maxsize
# Try every coin that has smaller value than V
for i in range(0, m):
if (coins[i] <= V):
sub_res = minCoins(coins, m, V-coins[i])
# Check for INT_MAX to avoid overflow and see if
# result can minimized
if (sub_res != sys.maxsize and sub_res + 1 < res):
res = sub_res + 1
// https://t.me/Coding_human
return res
# Driver program to test above function
coins = [9, 6, 5, 1]
m = len(coins)
V = 11
print("Minimum coins required is",minCoins(coins, m, V))
Python 3
Telegram:- https://t.me/Coding_human
Guys ❤️
Infosys Exam 3 PM Solution
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
Infosys Exam 3 PM Solution
Telegram:- https://t.me/infosys_sp_dsp_all_code
https://t.me/Coding_human
Note : Some codes are already in the channel/group, you can search the code by their names.
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string str;
cin >> str;
int n = str.length(), ans = 0;
for(int i = 0; i < n; i++){
if(str[i] == '5' || str[i] == '6')
continue;
else
ans += 1;
}
cout << ans << endl;
}
return 0;
}
Beautiful Number
Telegram:- https://t.me/Coding_human
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string str;
cin >> str;
int n = str.length(), ans = 0;
for(int i = 0; i < n; i++){
if(str[i] == '5' || str[i] == '6')
continue;
else
ans += 1;
}
cout << ans << endl;
}
return 0;
}
Beautiful Number
Telegram:- https://t.me/Coding_human
// Word Subset
class Solution:
def wordSubsets(self, words1: List[str], words2: List[str]) -> List[str]:
ans = set(words1)
letters = {}
for i in words2:
for j in i:
count = i.count(j)
if j not in letters or count > letters[j]:
letters[j] = count
for i in words1:
for j in letters:
if i.count(j) < letters[j]:
ans.remove(i)
break
return list(ans)
Python 3
Telegram:- https://t.me/Coding_human
class Solution:
def wordSubsets(self, words1: List[str], words2: List[str]) -> List[str]:
ans = set(words1)
letters = {}
for i in words2:
for j in i:
count = i.count(j)
if j not in letters or count > letters[j]:
letters[j] = count
for i in words1:
for j in letters:
if i.count(j) < letters[j]:
ans.remove(i)
break
return list(ans)
Python 3
Telegram:- https://t.me/Coding_human
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll solve(ll n)
{
ll position = 1;
ll m = 1;
while (!(n & m)) {
m = m << 1;
position++;
}
return position;
}
int main() {
// your code goes here
ll n,p;
cin>>n;
vector<int> ans(n);
for(int i=0;i<n;i++)
{
cin>>p;
ans[i] = solve(p+1);
}
for(int i=0;i<n;i++)
cout<<ans[i]<<"\n";
return 0;
}
C++
Telegram:-https://t.me/Coding_human
using namespace std;
#define ll long long int
ll solve(ll n)
{
ll position = 1;
ll m = 1;
while (!(n & m)) {
m = m << 1;
position++;
}
return position;
}
int main() {
// your code goes here
ll n,p;
cin>>n;
vector<int> ans(n);
for(int i=0;i<n;i++)
{
cin>>p;
ans[i] = solve(p+1);
}
for(int i=0;i<n;i++)
cout<<ans[i]<<"\n";
return 0;
}
C++
Telegram:-https://t.me/Coding_human
Amazon Prime Members & Flipkart Plus Members Stay Super Active Tonight For Freedom Sale. ♥️🤩
Best loot deals milegi , iski guarantee humaari😍
https://t.me/DMADLootz/12969
Join Prime Before Sale : https://t.me/DMADLootz/11596
Most Important : Many Loots Will Be Live For Few Minutes Or Seconds, So Turn On Channel Notification & Pin The Channel On Top, So That You Won't Miss Any Loots.
Share Our Telegram Channel With Your Friends/Family Members for Upcoming Loots :
https://t.me/DMADLootz
Best loot deals milegi , iski guarantee humaari😍
https://t.me/DMADLootz/12969
Join Prime Before Sale : https://t.me/DMADLootz/11596
Most Important : Many Loots Will Be Live For Few Minutes Or Seconds, So Turn On Channel Notification & Pin The Channel On Top, So That You Won't Miss Any Loots.
Share Our Telegram Channel With Your Friends/Family Members for Upcoming Loots :
https://t.me/DMADLootz
⭕L&T Technical Interview Experience⭕
1) Overview of internship?
2) What you have learned from the
internship?
3) Safety measures adopted by the
company?
4) What practical exposure did you get
during the internship?
5) What is bio-fuel?
6) What is the impact of bio-fuel blending
on the economy? (I had said my
interest is reading business news)
7) Do you know the process of biofuel
manufacturing?
8) Explain "Fuel and
combustion" (Elective subject).
9) Why excess air is required during
combustion?
10) What is the half-burned coal is
called? What will you do with that?
Note: No questions were asked from
the final year project. Majority Of
Questions (Internship, Elective
Subject, Hobbies).
Tips: 1) Read thoroughly the internship
report.
2) Basics of MTO, HTO, FFO, CET are
important.
3) Knowledge about software like
DWSIM/ASPAN can give you an
upper edge.
Telegram - https://t.me/Coding_human
1) Overview of internship?
2) What you have learned from the
internship?
3) Safety measures adopted by the
company?
4) What practical exposure did you get
during the internship?
5) What is bio-fuel?
6) What is the impact of bio-fuel blending
on the economy? (I had said my
interest is reading business news)
7) Do you know the process of biofuel
manufacturing?
8) Explain "Fuel and
combustion" (Elective subject).
9) Why excess air is required during
combustion?
10) What is the half-burned coal is
called? What will you do with that?
Note: No questions were asked from
the final year project. Majority Of
Questions (Internship, Elective
Subject, Hobbies).
Tips: 1) Read thoroughly the internship
report.
2) Basics of MTO, HTO, FFO, CET are
important.
3) Knowledge about software like
DWSIM/ASPAN can give you an
upper edge.
Telegram - https://t.me/Coding_human
THRYVE DIGITAL & WILEY EDGE EXAM SOLUTION GROUP:
https://t.me/Coding_human
https://t.me/thryve_digital_wiley_edge_code
✅ Share post in ur college Whatsapp grps.
https://t.me/Coding_human
https://t.me/thryve_digital_wiley_edge_code
✅ Share post in ur college Whatsapp grps.