nekomata_saren@tg says to YSITD
O(n log n)?