Amazon Warehouse Picking Distance
Amazon Warehouse Picking Distance
MediumArrays0% accepted
Arjun works at an Amazon warehouse in Bangalore picking items from different shelf sections. To minimize his walking distance, he needs to find the shortest path starting from position 0 and visiting all required shelf positions. Route rule: you start at position 0, must visit every shelf position, and return to 0 — minimum distance is twice the farthest position.
Approach
Given array of shelf positions, find minimum distance to visit all positions starting from 0, returning to 0.
Input
5
3 6 1 2 5
Output
12
More Arrays problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
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