You are given an undirected and connected graph with n nodes. Intially you are at node 1, and need to travel to node n. There are power boosters at k nodes, and every time you arrive at a power booster node, your power is set to p, which allows you to walk cross p edges. What is the minimum value of p such that you can reach node n from node 1?
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.