Pergunta de entrevista da empresa Fiserv

One question about DSU and best time complexity possible