Return the array sum after each value-replacement transaction.
Unlock detailed company stats for this questionUpgrade
Given a list of integers entries and a 2D list transactions of pairs [old_v, new_v], process each pair by finding all indexes where entries[idx] == old_v and replacing those values with new_v, then calculating the sum of all numbers in entries. Return the list of sums after each transaction. Brute force solutions are not accepted even if they pass the tests, and sums can overflow for large inputs (use 64-bit integers).
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
