Algorithm · Robinhood · Easy
You receive a sequence of non-empty strings, strings, along with an integer k representing the number of lines (or buckets). Handle the strings from left to right, placing every string onto exactly one line. Part 1 (unrestricted placement) Write a method that puts each string onto any one of the k lines. Return the resulting collection of strings on every line; no string may be divided across lines. Part 2 (always choose the least-loaded line) A line's load is the total…
Checking your access…