Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3108. Minimum Cost Walk in Weighted Graph
For each query, find the smallest possible bitwise AND of edge weights along any walk (edges/vertices may repeat) between two nodes in an undirected weighted graph, or return -1 if they are disconnected. The core challenge is exploiting the monotonic properties of bitwise AND together with fast connectivity checks to determine which bitmask values are achievable at scale (n, edges, queries up to 1e5).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.