Available question text
Given a weighted graph where some edges are designated as highways, find the maximum-cost trip between two nodes while using at most K highways (or exactly K, per statement), which requires treating the number of highways used as an extra state and solving a constrained longest-path problem via DP/state-expanded graph techniques (e.g., modified Dijkstra/Bellman-Ford over node×k states) to manage cycles and the K constraint.
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
Meta
Leetcode 2247. Maximum Cost of Trip With K Highways
Reported Jan 14, 2025 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source