Skip to content

A puzzle solver of a problem "where to move in" to stay in touch with friends.

License

Notifications You must be signed in to change notification settings

PuzzleLearning/where-to-movein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

where-to-movein

A puzzle solver of a problem "where to move in" to stay in touch with friends.

You have 9 friends, who live in 9 houses within a one straight street. Lengths of particular houses counting from the left beginning of the street are like below:

  • A — 1.1 km
  • B — 2.3 km
  • C — 3.0 km
  • D — 4.2 km
  • E — 5.1 km
  • F — 6.3 km
  • G — 13.4 km
  • H — 19.1 km
  • I — 27.5 km

On which particular kilometre on the street (counting from the left) you would hire a flat, to minimize the sum of the lengths to all your friends, who live on the same street? In other words: find the point X, for which function: dist(A,X) + dist(B,X) + … + dist(I,X) gives smallest value.

About

A puzzle solver of a problem "where to move in" to stay in touch with friends.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages