I am trying to solve Morse Code. I failed to understand the solution after spending two hours reading others' codes. Despite an editorial, unfortunately, I cannot understand even a single word of it. With all due respect, I believe the editorial is not written well.
I appreciate if you explain the solution and let me know what exactly $$$f(l, r)$$$ and $$$g(l, r)$$$ are, and why we need them. That would be great if you can explain me why we need LCP, too.