Deloitte | PWC | ATS resumes | Wipro | Infosys | Accenture | Capegemini | job links
Ir al canal en Telegram
WhatsApp group link https://chat.whatsapp.com/Il915UNLpw32YjwxFf8D63
Mostrar más4 673
Suscriptores
Sin datos24 horas
-17 días
-630 días
Archivo de publicaciones
Infosys codes❤️
1) Army invasion
2) Disturbuting books
3) Count subtree factors code
4) Task management
Contact @placementsBro😎
All test cases passed✅
https://t.me/Infycodes
Disturbuting books code✅
https://t.me/Infycodes
Contact @placementsBro😎
Count subtree factors done✅
https://t.me/Infycodes
Contact @placementsBro😎
#include<bits/stdc++.h>
using namespace std;
#define int long long
int findMax(vector<int>& a, vector<int>& height, int n, int i, int h, vector<vector<int>>& dp) {
if (i >= n) return 0;
if (dp[i][h] != -1) return dp[i][h];
int vol = height[i] * a[i] * a[i];
int inc = 0;
int exc = 0;
if (vol > h) {
inc = vol + findMax(a, height, n, i + 1, vol, dp);
}
exc = findMax(a, height, n, i + 1, h, dp);
return dp[i][h] = max(inc, exc);
}
int32_t main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
vector<int> height(n);
for (int i = 0; i < n; i++) cin >> height[i];
int maxVol = 0;
for (int i = 0; i < n; i++) {
maxVol = max(maxVol, height[i] * a[i] * a[i]);
}
// Using the maximum possible value of h to size the dp table
vector<vector<int>> dp(n, vector<int>(maxVol + 1, -1));
int ans = findMax(a, height, n, 0, 0, dp);
cout << ans << endl;
return 0;
}
Volume of cylinder ✅
https://t.me/Infycodes
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
int N, M;
cin >> N >> M;
vector<vector<int>> grid(N, vector<int>(M));
for (int i = 0; i < N; ++i)
{
for (int j = 0; j < M; ++j)
{
cin >> grid[i][j];
}
}
vector<vector<long long>> dp(N, vector<long long>(M, 0));
vector<vector<long long>> dogDistance(N, vector<long long>(M, LLONG_MAX));
if (grid[0][0] == 0)
{
dogDistance[0][0] = 0;
}
dp[0][0] = grid[0][0];
for (int i = 0; i < N; ++i)
{
for (int j = 0; j < M; ++j)
{
if (i == 0 && j == 0)
continue;
if (i > 0)
{
dp[i][j] = max(dp[i][j], dp[i - 1][j] + grid[i][j] - dogDistance[i - 1][j]);
dogDistance[i][j] = min(dogDistance[i][j], dogDistance[i - 1][j] + 2);
}
if (j > 0)
{
dp[i][j] = max(dp[i][j], dp[i][j - 1] + grid[i][j] - dogDistance[i][j - 1]);
dogDistance[i][j] = min(dogDistance[i][j], dogDistance[i][j - 1] + 2);
}
if (grid[i][j] == 0)
{
dogDistance[i][j] = 0;
}
}
}
cout << dp[N - 1][M - 1] << endl;
return 0;
}
Lost in Orange Grove ✅
https://t.me/Infycodes
def max_beauty_sum(A, intervals):
N = len(A)
intervals.sort(key=lambda x: x[1])
dp = [0] * (N + 1)
last_non_overlapping = [0] * (N + 1)
for start, end in intervals:
distinct = set(A[start-1:end])
beauty = sum(distinct)
prev_end = last_non_overlapping[start-1]
dp[end] = max(dp[end], dp[prev_end] + beauty)
for i in range(end, N + 1):
last_non_overlapping[i] = max(last_non_overlapping[i], end)
return max(dp)
Interval maximization ✅
https://t.me/Infycodes
def count_not_divisible(K, L, R):
def sieve_of_eratosthenes(n):
is_prime = [True] * (n + 1)
primes = []
for p in range(2, n + 1):
if is_prime[p]:
primes.append(p)
for multiple in range(p * p, n + 1, p):
is_prime[multiple] = False
return primes
def count_divisible_up_to(x, primes):
from itertools import combinations
count = 0
for i in range(1, len(primes) + 1):
for comb in combinations(primes, i):
lcm = 1
for num in comb:
lcm *= num
if lcm > x:
break
if lcm > x:
continue
if i % 2 == 1:
count += x // lcm
else:
count -= x // lcm
return count
def count_not_divisible_up_to(x, primes):
if x == 0:
return 0
return x - count_divisible_up_to(x, primes)
L = int(L)
R = int(R)
primes = sieve_of_eratosthenes(K)
count_R = count_not_divisible_up_to(R, primes)
count_L_minus_1 = count_not_divisible_up_to(L - 1, primes)
return count_R - count_L_minus_1
K = int(input().strip())
L = input().strip()
R = input().strip()
result = count_not_divisible(K, L, R)
print(result)
Divisible string ✅
Infosys
Take management code done
from collections import defaultdict, deque
def dfs_count(node, parent, adj, A, mod_target):
count = 0
stack = [(node, parent)]
while stack:
current, parent = stack.pop()
if A[current] % 3 == mod_target:
count += 1
for neighbor in adj[current]:
if neighbor != parent:
stack.append((neighbor, current))
return count
def solve(N, M, A, E, Q, Queries):
adj = defaultdict(list)
for u, v in E:
adj[u-1].append(v-1)
adj[v-1].append(u-1)
total_result = 0
for query in Queries:
if query[0] == 1:
_, U, X = query
U -= 1
A[U] = X
elif query[0] == 2:
_, U, X = query
U -= 1
mod_target = X % 3
count = dfs_count(U, -1, adj, A, mod_target)
total_result += count
return total_result % (10**9 + 7)
Path Queries On MOD
Share our channel
https://t.me/Infycodes
Be ready for codes✅
Infosys exam Answer's
https://t.me/Infycodes
Infosys exam Answer's
https://t.me/Infycodes
https://www.meesho.io/jobs/software-development-engineer-i-data?id=fdbc2008-63d6-4334-8d9b-0dfa94ce4256
Meesho Hiring Software Development Engineer 1 - Data
Convert design to code seamlessly
Develop proofs-of-concept and prototypes for development in Java, Python
Hands-on In Spark, Scala/Pyspark.
Hands-on working on cloud platform
Good knowledge in Data-lake
Develop long-term strategies for newbie engineers that work in favor of the organization
Resolve bugs on time and make edits according to the feedback
Stay updated with emerging tech cultures and identify the right opportunities to implement them
Ensure content quality and consistency of the brand
What you will need
B.Tech, preferably from premier institutions
Excellent coding skills - should be able to convert design into code fluently
Ability to create prototypes and proofs of concept for iterative development in Java / Python
Good understanding of data structures and algorithms and their space and time complexities
Strong hands-on and practical working experience with Java / Python
Strong problem-solving skills
Last call for techm ✅
