← Questions
Maximum sum of a subarray whose ends differ by k
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Given an integer array and k, a subarray is good when its first and last elements differ by exactly k. Return the largest sum of a good subarray, or 0 if there is none.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
