Pergunta de entrevista da empresa NoBroker

I recently encountered a challenging data structure and algorithm question that I have been struggling to fully solve. Despite my best efforts and attempts at problem-solving, I have not been able to come up with a complete solution. The question has posed a significant challenge for me, requiring a deep understanding of various algorithms and data structures. I have sought help from online resources, tutorials, and fellow programmers, but I am still unable to crack the problem entirely. I am determined to continue working on it and improve my skills in order to ultimately find the solution.