Samsung Interview Question for Software Developers
- 0of 0 votes
A delivery boy wants to deliver some items on his way from office to home. You need to find the optimized path he should take from office to home and deliver all his deliveries on his way.- mirinda January 09, 2016 in India
It is 101 X 101 grid. Office, home , delivery points are represented via coordinated (x,y) where 0 <= x <= 100, 0 <= y <= 100.
distance between two points (x1, y1) and (x2,y2) is computed as |x1 - x2| + |y1 - y2|
You need to find the optimized path from office to home covering all delivery locations and return the optimized path length as output.
You will be given the input in the 2 lines
first line - N (no. of delivery locations)
second line - (x,y) coordinates of office, followed by home, followed by all N delivery locations.
0 0 100 100 20 30 50 50 70 70
output: The length of the optimized path taken.
For above input, the output is 200
| Report Duplicate | Flag | PURGE
Samsung Software Developer Problem Solving
Interview Type: Written Test
Open Chat in New Window