COGNIZANT EXAM HELP GROUP
3.55K subscribers
5.3K photos
21 videos
10 files
3.22K links
🚀 Placement Preparation Hub

🎓 From Preparation to Placement

OA Support • Coding • Aptitude • Technical • HR

🌟 Trusted by Hundreds of Students

🏆 372+ Placement Successes

📩 DM: @Mrtrueliving_ix

💙 Turning Aspirations into Offer Letters.
Download Telegram
Cognizant Slots booking are open....


DM
@Mrtrueliving_ix

Test clearance guarantee
💯
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
NCAT Help done ✔️

TEST ACCOMPLISHED ❤️

DM
@Mrtrueliving_ix
Please open Telegram to view this post
VIEW IN TELEGRAM
Autodesk all codes available

DM @Mrtrueliving_ix
Please open Telegram to view this post
VIEW IN TELEGRAM
Namma Yatri - R2 Help available

DM @Mrtrueliving_ix


https://t.me/code_alphix/5940?single
Please open Telegram to view this post
VIEW IN TELEGRAM
Medplus sending hall ticket 🎟️....


Best of luck 🤞❤️
Cognizant Aptitude Help done

4 pm ||  Slot
💻

DM for help
@Mrtrueliving_ix 💯

#Cts #Aptitude #R2 #Offcampus

Test accomplished ❤️
Please open Telegram to view this post
VIEW IN TELEGRAM
Cognizant - 6pm || ibm cic Help available

DM
@Mrtrueliving_ix for help

Test clearance
💯
Please open Telegram to view this post
VIEW IN TELEGRAM
PayU Help available

DM.... @Mrtrueliving_ix
Please open Telegram to view this post
VIEW IN TELEGRAM
Dtcc code-A-Thon Help available

DM @Mrtrueliving_ix 🎉
Please open Telegram to view this post
VIEW IN TELEGRAM
IBM all codes available

DM @Mrtrueliving_ix ✔️
Please open Telegram to view this post
VIEW IN TELEGRAM
IBM CIC Help Done

Slot -2 ✔️
Please open Telegram to view this post
VIEW IN TELEGRAM
PayU Help done

DM
@Mrtrueliving_ix for Help 🎉💯

#PayU #Offcampus
Please open Telegram to view this post
VIEW IN TELEGRAM
import sys
sys.setrecursionlimit(1_000_000)

class DirNode:
def __init__(self, name):
self.name = name
self.children = {}
self.parent = None

class DirectoryTree:
def __init__(self):
self.root = DirNode("root")
self.total_nodes = 1
self.MAX_NODES = 10**6
self.path_map = {"root": self.root}

def get_node(self, path):
return self.path_map.get(path, None)

def build_path(self, parent_path, child_name):
return parent_path + "/" + child_name

def add_node(self, parent_path, *child_names):
parent = self.get_node(parent_path)
if not parent:
return
for name in child_names:
if name not in parent.children:
new_node = DirNode(name)
new_node.parent = parent
parent.children[name] = new_node
full_path = self.build_path(parent_path, name)
self.path_map[full_path] = new_node
self.total_nodes += 1

def count_descendants(self, path):
node = self.get_node(path)
if not node:
print("Invalid command")
return

def dfs(n):
count = 0
for cname, ch in n.children.items():
count += 1 + dfs(ch)
return count

print(dfs(node))

def cut_paste(self, src_path, dst_path):
src = self.get_node(src_path)
dst = self.get_node(dst_path)

if not src or not dst or src is self.root or src.name in dst.children:
print("Invalid command")
return

# Remove old paths
def remove_paths(n, current_path):
self.path_map.pop(current_path, None)
for cname, ch in n.children.items():
remove_paths(ch, self.build_path(current_path, cname))

remove_paths(src, src_path)

# Detach from old parent
del src.parent.children[src.name]

# Attach to new parent
src.parent = dst
dst.children[src.name] = src

# Add new paths
def add_paths(n, current_path):
self.path_map[current_path] = n
for cname, ch in n.children.items():
add_paths(ch, self.build_path(current_path, cname))

new_path = self.build_path(dst_path, src.name)
add_paths(src, new_path)

print("OK")

def copy_paste(self, src_path, dst_path):
src = self.get_node(src_path)
dst = self.get_node(dst_path)

if not src or not dst or src.name in dst.children:
print("Invalid command")
return

# Count number of nodes to be added
def count_nodes(n):
cnt = 1
for ch in n.children.values():
cnt += count_nodes(ch)
return cnt

needed = count_nodes(src)
if self.total_nodes + needed > self.MAX_NODES:
print("Invalid command")
return

# Clone subtree
def clone(n):
copy = DirNode(n.name)
for cname, ch in n.children.items():
child_copy = clone(ch)
child_copy.parent = copy
copy.children[cname] = child_copy
return copy

new_subtree = clone(src)
new_subtree.parent = dst
dst.children[new_subtree.name] = new_subtree

# Add new paths to map
def add_paths(n, current_path):
self.path_map[current_path] = n
for cname, ch in n.children.items():
add_paths(ch, self.build_path(current_path, cname))

new_path = self.build_path(dst_path, src.name)
add_paths(new_subtree, new_path)

self.total_nodes += needed
print("OK")

Part -1
👍3
# Input handling
def main():
n, q = map(int, input().split())
tree = DirectoryTree()

for _ in range(n):
parts = input().split()
parent = parts[0]
children = parts[1:]
tree.add_node(parent, *children)

for _ in range(q):
parts = input().split()
cmd = parts[0]
if cmd == "countDescendants":
tree.count_descendants(parts[1])
elif cmd == "cutPaste":
tree.cut_paste(parts[1], parts[2])
elif cmd == "copyPaste":
tree.copy_paste(parts[1], parts[2])

if __name__ == "__main__":
main()

Part - 2


Namma yatri - 2 ✔️
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Successfully cleared NetApp ✔️

Test accomplished

Prev Help:

https://t.me/code_alphix/6137?single

DM for help
@Mrtrueliving_ix ° @Mrtrueliving_ix

💯 Success Rate & Test clearance 👌
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
All placement help available

- Cognizant
- Dtcc
- payU
- namma yatri
- wells forgo
- IBM - communication
- Deshaw
- innofied
- IBM - offline
- Flipkart


On // off campus placement

DM For help
@Mrtrueliving_ix
@Mrtrueliving_ix

Test clearance guarantee
💯

High success rate
🎉
Please open Telegram to view this post
VIEW IN TELEGRAM
Amazon

Programe analyst

https://t.me/jobUpdatesclub


Test link confirm 👍💯
Please open Telegram to view this post
VIEW IN TELEGRAM
Accolite Help available & codes available...

DM @Mrtrueliving_ix 💻💯
Please open Telegram to view this post
VIEW IN TELEGRAM
Accolite Help done 🎉
Test accomplished

DM
@Mrtrueliving_ix for help

#Accolite #Offcampus
Please open Telegram to view this post
VIEW IN TELEGRAM