Postman Beat Traffic Weighted Path
Postman Beat Traffic Weighted Path
Ravi is a postman covering a beat area in Pune with N houses. Roads between houses have varying traffic weights. Find the minimum weighted distance to visit all houses and return to start. Rule: weights[i][j] is the road cost between houses i and j. Start at house 0, visit every house exactly once, return to house 0. Return the minimum total cost (n <= 6). Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given an array of house positions with traffic weights, find the minimum weighted path visiting all houses.
Input
Output
More Arrays problems
Browse all coding problems →Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards