Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Model currencies as nodes and exchange rates as weighted edges in a directed graph.
Find the maximum product path between a source and destination currency.
Return -1.0 if either currency is invalid or no conversion path exists.
What This Tests
Graph construction and adjacency list representation
Depth-first search for exploring weighted paths
Cycle detection and state tracking during traversal
Handling edge cases and missing inputs
Common Patterns
Graph Traversal
DFS/BFS
Hashing
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
1.1k
/2.3k
Acceptance Rate
46.8%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected