[LeetCode] Allocate Mailboxes

1 · · Feb. 24, 2022, 4:31 a.m.
1478. Allocate Mailboxes Given the array houses where houses[i] is the location of the ith house along a street and an integer k, allocate k mailboxes in the street. Return the minimum total distance between each house and its nearest mailbox. The test cases are generated so that the answer fits in a 32-bit integer. ...