def printMostSignificant(msg):
return max(msg.split(), key=lambda word: sum(ord(c.lower()) - 96 for c in word if c.isalpha()))
if __name__ == "__main__":
msg = input().strip()
print(printMostSignificant(msg))
Gs 2
β€3
int processResult(int N, const vector<int>& maleHeights, const vector<int>& femaleHeights) {
vector<int> a, b, c, d;
for (int x : maleHeights) {
if (x > 0) a.push_back(x);
else b.push_back(-x);
}
for (int x : femaleHeights) {
if (x > 0) c.push_back(x);
else d.push_back(-x);
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
sort(c.begin(), c.end());
sort(d.begin(), d.end());
int i = 0, j = 0, r = 0;
while (i < a.size() && j < d.size()) {
if (a[i] < d[j]) {
r++;
i++;
j++;
} else {
j++;
}
}
i = 0, j = 0;
while (i < b.size() && j < c.size()) {
if (b[i] > c[j]) {
r++;
i++;
j++;
} else {
i++;
}
}
return r;
}
Gs 3
β€5π1
def findConnectedKingdoms(N, E, roads, P, invaders):
from collections import defaultdict, deque
graph = defaultdict(list)
defenders = set(range(N)) - invaders
for u, v in roads:
if u in defenders and v in defenders:
graph[u].append(v)
graph[v].append(u)
visited = set()
groups = []
def bfs(start):
queue = deque([start])
group = []
visited.add(start)
while queue:
node = queue.popleft()
group.append(node)
for neighbor in graph[node]:
if neighbor not in visited:
visited.add(neighbor)
queue.append(neighbor)
return sorted(group)
for node in defenders:
if node not in visited:
group = bfs(node)
groups.append(group)
groups.sort()
for group in groups:
print(' '.join(map(str, group)))
def main():
import sys
input = sys.stdin.read
data = input().split()
index = 0
N = int(data[index])
index += 1
E = int(data[index])
index += 1
roads = []
for _ in range(E):
u = int(data[index])
v = int(data[index + 1])
roads.append((u, v))
index += 2
P = int(data[index])
index += 1
invaders = set()
for _ in range(P):
invaders.add(int(data[index]))
index += 1
findConnectedKingdoms(N, E, roads, P, invaders)
main()
Gs4
β€3
def get_overlap(a: str, b: str) -> int:
max_overlap = 0
min_len = min(len(a), len(b))
for length in range(1, min_len + 1):
if a[-length:] == b[:length]:
max_overlap = length
return max_overlap
def make_playlist(N: int, snippets: list[str]) -> str:
tracks = snippets.copy()
merged = [False] * N
while True:
best_a = -1
best_b = -1
best_overlap = 0
best_merged = ""
for i in range(N):
if merged[i]:
continue
for j in range(N):
if i == j or merged[j]:
continue
overlap = get_overlap(tracks[i], tracks[j])
if overlap > best_overlap:
best_overlap = overlap
best_a = i
best_b = j
best_merged = tracks[i] + tracks[j][overlap:]
if best_overlap == 0:
break
tracks[best_a] = best_merged
merged[best_b] = True
result = ""
for i in range(N):
if not merged[i]:
result += tracks[i]
return result
def main():
import sys
input = sys.stdin.read().splitlines()
N = int(input[0])
snippets = input[1:N+1]
print(make_playlist(N, snippets))
main()
//playlist π
β€1π1
Successfully cleared JUSPAY R2
Test accomplished β€οΈ
DM @Mrtrueliving_ix for Test Clearance β€οΈ
Prev
https://t.me/code_alphix/6256?single
https://t.me/code_alphix/6259?single
#JUSPAY #ONCAMPUS #SHORTLISTED
Test accomplished β€οΈ
DM @Mrtrueliving_ix for Test Clearance β€οΈ
Plagfree coding & High success rate π€
Prev
https://t.me/code_alphix/6256?single
https://t.me/code_alphix/6259?single
#JUSPAY #ONCAMPUS #SHORTLISTED
β€1
All placement help available
>> Wipro Elite
>> Toast
>> ICICI
>> JUSPAY
>> ibm
>> Amazon SDE
>> Hackerank
>> Infoedge ( final call)
>> Meesho
Any other OA help available
On // off campus
DM @Mrtrueliving_ix for test clearance π―
>> Wipro Elite
>> Toast
>> ICICI
>> JUSPAY
>> ibm
>> Amazon SDE
>> Hackerank
>> Infoedge ( final call)
>> Meesho
Any other OA help available
On // off campus
DM @Mrtrueliving_ix for test clearance π―
Forwarded from COGNIZANT EXAM HELP GROUP
Infoedge R2 Help available
DM @Mrtrueliving_ix for clearance
Previous helping proofs
https://t.me/code_alphix/6352?single
DM @Mrtrueliving_ix for clearance
Previous helping proofs
https://t.me/code_alphix/6352?single
Infoedge R2 Help Done β
4/4 codes π
Test accomplished πͺ
DM @Mrtrueliving_ix π for clearance
#Infoedge #R2
4/4 codes π
Test accomplished πͺ
DM @Mrtrueliving_ix π for clearance
Only 2 hrs left
#Infoedge #R2
JUSPAY part A Help done β
DM @Mrtrueliving_ix for Test Clearance π€
#JUSPAY #partA #ONCAMPUS
Previous helping proofs
https://t.me/code_alphix/6420
DM @Mrtrueliving_ix for Test Clearance π€
#JUSPAY #partA #ONCAMPUS
Previous helping proofs
https://t.me/code_alphix/6420
Infoedge only 20 mins left
DM @Mrtrueliving_ix for test clearance
https://t.me/code_alphix/6428?single