Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
رفتن به کانال در Telegram
Main channel https://t.me/Coding_000 Contact Admin 👉 @ILOVEU_143 for booking your exam slots Web- https://coding000.github.io/Projects/ 💯% clearance in any placement exams OffCampus -https://t.me/Offcampus_000 Discussion- https://t.me/exams_discussion
نمایش بیشتر3 362
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-67 روز
-3930 روز
آرشیو پست ها
All codes uploaded check above..👆👆👆👆👆👆 And pls share our channel @Coding_000✅❤️😍
def Solve(N,A,P):
mod = int(1e9) + 7
score = 0
for i in range(N):
mex = 1
while mex in A:
mex += 1
A[P[i]-1] = N + P[i]
score += mex*(i+1)
score %= mod
return score
Python
All codes uploaded check above..👆👆👆👆👆👆 And pls share our channel @Coding_000✅❤️😍
Python
Smallest lexicographical array Minimum possible cost
Telegram:- @Coding_000✅
given an array A of size N.
You are allowed to choose at most one pair of elements such that distance (defined as the difference of their indices) is at most K and swap them.
Find the smallest lexicographical array possible after
Notes:
An array x is lexicographically smaller than an array y if there exists an index i such that xi A[j]) {
swap(A[i], A[j]);
swapped = true;
break;
}
}
if (swapped) break;
}
if (!swapped) return A;
else return A;
C++
Share ur frds...i will share more ans...here...
You are given a rooted tree of N vertices and an array A of N integers A[i] is the parent of the vertex (i+1 or 0 if the vertex (i+1) is the root.
For each vertex V from 1 to N, the answer K is the total number of subsets of vertices with the LCA (lowest common ancestor) equal to V Since the of K can be large calculate it modulo 10 ^ 9 + 7
Let there be an integer array Res where Res[i] contains the answer for (I + 1)th vertex, Find the array Res
Notes:
• The lowest common ancestor (LCA) is defined for X nodes A1, A2,.... Ax as the lowest node in the tree that has all A1 A2..... Ax as descendants (where we allow a node to be a descendant of itself)
Input Formate
The first line contains an integer N denoting the number of elements in A
Each line 1 of the N subsequent lines (where 0<=i g[N];
void dfs(int u) {
dp[u] = 1;
for (int v : g[u]) {
dfs(v);
dp[u] = 1ll * dp[u] * (dp[v] + 1) % MOD;
}
res[u] = (1ll * dp[u] * (1 << g[u].size()) - 1 + MOD) % MOD;
}
vector functionName(int n,vectorA)
{
g=A;
dfs(1);
return res;
}
Language c++
Infosys codes uploading...👇💥
My request to our group family don't trust anyone simply and don't lose money 🙏🥹
we will share ans...here...✅
Share 😊 @Coding_000 ✅
Deliotee code done...any one want dm @ILOVEU_143
Guys share questions here...👇👇
https://t.me/exams_discussion
share and support ✅
Share this group as much as possible✅✅
Add your friends here ✅✅
https://t.me/Coding_000
Guys add ur frds...who have infosys now... @Coding_000✅
see the mrg slot ans..👆👆 and share our channel..✅
اکنون در دسترس! پژوهش تلگرام ۲۰۲۵ — مهمترین بینشهای سال 
