NAVI TECHNOLOGIES Hiring On-Campus OA (2023) | Problem Sum of Scores of Built Strings
Question · Posted Jun 2026
Problem Statement Given a string s of length n, define the score of index i as the length of the longest common prefix between: The entire string s The suffix starting at index i Return the sum of scores for all indices. Example Input: s = "aabaa" Output: 11 Explanation: Suffix Common Prefix Length aabaa 5 abaa 1 baa 0 aa 2 a 1 Total Score: 5 + 1 + 0 + 2 + 1 = 11 Test Cases Test ...
The full answer & interview discussion are available to premium members.
Log in Create a free account