Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 766 Bytes

ae0001.md

File metadata and controls

33 lines (25 loc) · 766 Bytes

Best Suited Apartment

Imagine that you are moving to a new location, and all the candidate apartments are in blocks of one street. In each block there are some buildings that you value e.g. office, supermarket, school, etc.

Choose the best suited apartment that can minimize the farest distance that you have to walk to all the places you value.

link: https://www.youtube.com/watch?v=rw4s4M3hFfs&t=940s

Example:

blocks = [ { "gym": false, "school": true, "store": false, }, { "gym": true, "school": false, "store": false, }, { "gym": false, "school": true, "store": false, }, ]

req = ["gym", "school", "store"]

Source Code

  1. hard-coded