Mary plans a round-world trip in which he would like to visit a number of friends at each city she stops at. She sorts the cities according to the number of friends so she can visit P friends at Pth city of the trip, where k = 1, 2, ...., N, coincidently. Assume that it would take 1 day for Mary to visit one friend including the local travel time, and also 1 day for her to travel from one city to the next.
How should i write in simple java...