← Questions

Most relevant span of text by character scores

0
HebbiaCodingLast asked Apr 2025

A coding interview question asked in Hebbia's coding screen, last asked Apr 2025. It tests arrays, dynamic programming and strings.

You get a lowercase string text and an integer array scores of the same length, where scores[i] is the relevance of text[i]. The relevance of a contiguous, non-empty span is the sum of its scores.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

arrays · dynamic programming · strings

Your code and the AI tutor open when you unlock this question.