← All problemsSign in

Maximum Magic Walk

Given is an undirected weighted graph with n vertices and m edges. There may be self loops and/or multiple edges in the graph. A u-v walk is defined as a sequence of vertices starting at u and ending at v, where consecutive vertices in the sequence are adjacent vertices in the graph i.e. consecutive vertices are connected by some edge. An arbitary walk of length k+1 is, V1,E1,V2,E2,V3,...,Vk,Ek,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start