Problem 1537 · Hard

Get the Maximum Score

Walk two sorted lists with two pointers, keeping a running sum for each; at each shared value, switch to whichever running sum is larger.

Open the interactive visualisation