Compute each computer's score as the sum of task numbers it completes in order.
Unlock detailed company stats for this questionUpgrade
v[i] is the operational power of the i-th computer and b[j] is the minimum power required to complete the j-th task. A computer performs tasks starting from task 0 in order until it encounters a task whose required power exceeds its capacity. Its score is the sum of the (1-based) task numbers it successfully completes. Example: v = [5, 6, 3, 10], b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; a computer with power 5 completes tasks up to index 4, scoring 1+2+3+4+5 = 15.
Format · Part of Amazon's SDE-1 online assessment.
Community answers
No answers contributed by the community yet.
Related questions
Compute a nested list sum where each depth level multiplies the numbers by its depth.Related courses

Course

Course
Course
