Meesho OA | Sde-Intern | Jan 2024 |
Meesho · Question · Posted Apr 2026
Problem: Hackerland Path Sequences The Scenario: The city of Hackerland is represented as an undirected tree with house_nodes (numbered 0 to n−1) and house_nodes - 1 edges. Each edge has a value val[i] which is either 0 or 1. The Goal: Find the number of sequences of houses (h[1],h[2],…,h[k]) of length k such that if you travel from h[1]→h[2]→h[k] using the unique shortest paths between consecutive houses, at least one edge with value 1 is visited during the entire journey. ...
The full answer & interview discussion are available to premium members.
Log in Create a free account