give array house housesi location ith house street integer k allocate k mailbox streetreturn minimum total distance house near mailboxthe test case generate answer fit 32bit integer Example 1input house 1481020 k 3output 5explanation Allocate mailbox position 3 9 20minimum total distance house near mailbox 31 43 98 109 2020 5 example 2input house 2351218 k 2output 9explanation Allocate mailbox position 3 14minimum total distance house near mailbox 23 33 53 1214 1814 9 Constraints1 k houseslength 1001 housesi 104All integer house unique