The first approach detailed in the solution results in a TLE (tried with both my own code and yours, Java and C++). Please adjust the solution text to advise the reader that the first approach is NOT ...
Unele rezultate au fost ascunse, deoarece pot fi inaccesibile pentru dvs.
Afișați rezultatele inaccesibile