Emergency Hospital Proximity
Emergency Hospital Proximity
EasyArrays100% accepted
Ravi develops routing software for ambulance dispatch in Bangalore. When an emergency call comes, the system calculates distances to all nearby hospitals. Find the closest hospital by minimum distance.
Approach
Given an array of N distances (in km) from emergency location to nearby hospitals in Bangalore, find the minimum distance to nearest hospital.
Input
[5.2, 3.8, 8.1, 2.9, 6.5]
Output
2.9
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