String Problem

Revision en2, by atharvd, 2023-06-11 21:54:46

I was introduced to this problem by someone on another platform; I have been thinking about the problem for a while, but I don't know what to do.

You are given string $$$T$$$ and a function $$$f(s)$$$. $$$f(s)$$$ takes in a string and outputs $$$len(s) * occur(s)$$$ where $$$len(s)$$$ is the length of the string and $$$occur(s)$$$ is the amount of times string $$$s$$$ occurs in $$$T$$$.

Find the maximum value of $$$f(s)$$$ over all substrings of $$$T$$$.

I am considering using the Z-algorithm to solve this; can someone tell me if this is the correct approach?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English atharvd 2023-06-12 23:16:03 36 Tiny change: 'gs of $T$.\n\nI am c' -> 'gs of $T$. The maximum length of $T$ is $10^5$\n\nI am c'
en2 English atharvd 2023-06-11 21:54:46 81
en1 English atharvd 2023-06-11 21:50:44 467 Initial revision (published)