← Questions
Most relevant span of text by character scores
0
I was asked this
No reports yet. Sign in to say where you were asked it.
You get a string and a relevance score (possibly negative) for each of its characters. Return the non-empty contiguous piece of the text whose scores add up to the most. On a tie, prefer the piece that starts earliest, then the shorter one. This is maximum subarray underneath: do it in one pass.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
