mirinda
BAN USER
- 0of 0 votes
AnswerA 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 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.
3
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 - 0of 0 votes
Answersmr bobo walks to a store with coins of some denominations.he purchases some things from the store such that the total price comes out to be x. mr bobo being extremly lazy man doesn't want to handle too many coins,so he decides that he is going to pay the shopkeeper only with 3 coins i.e., if any 3 or less coins sums upto x ,he will pay the shopkeeper. also being the miser he doesn't want to pay even extra penny. if he doesnot find 3 such coins he will drop the baggage.
- mirinda in United States
input:
totalprice
no.of coins
denominations
output:
we have to set output as upto 3 coins in increasing order of denomination if you find.
if no combination possible output is single array with element -9999
Ex:
TotalPrice = 100
no.of coins = 5
denominations = {10,30,40,50,70}
output1 = {30,70}
int output1[100];
void GetCoins(int totalPrice,int noOfCoins,int denominations[])
{
//Write code here
}| Report Duplicate | Flag | PURGE