How to solve this problem in O(log(n)*n) or less?

Правка en2, от pretending, 2021-07-17 17:03:05

I am stuck at this problem currently.

Problem link

I have tried a O(n^2) approach but the accepted solution is supposedly O(log(n)*n) or less. How do solve this?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский pretending 2021-07-17 17:03:05 755
en1 Английский pretending 2021-07-17 14:22:43 1016 Initial revision (published)