This set of problems evaluates algorithm design and problem-solving skills across array manipulation, range-update techniques, load-balancing and partitioning strategies, and combinatorial packing, testing competencies in complexity analysis, data-structure use, and optimization under constraints.
The coding rounds covered the following algorithmic problems:
+1/-1 operations
nums
and
target
of equal length
n
. In one operation, choose a contiguous subarray
nums[l..r]
and either add
1
to every element in that subarray or subtract
1
from every element in that subarray. Return the minimum number of operations needed to transform
nums
into
target
.
n
zeros. In one operation, choose a contiguous subarray and add
1
to every element in it. Given a target array of non-negative integers, return the minimum number of operations required to construct the target array.
jobs
, where
jobs[i]
is the time required for job
i
, and an integer
k
for the number of workers. Assign each job to exactly one worker. The load of a worker is the sum of job times assigned to that worker. Return the minimum possible value of the maximum worker load.
boxes
of box heights and an array
warehouse
of room heights arranged from left to right. You may reorder the boxes arbitrarily, but boxes can only be inserted from the left entrance. A box can pass through a room only if its height is no greater than the height limit of every room it must pass. Each room can store at most one box. Return the maximum number of boxes that can be placed in the warehouse.