Available question text
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).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3108. Minimum Cost Walk in Weighted Graph
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source