Good evening all,
I am reaching out, as I had some questions about the editorial for ABC 277 problem C. The editorial for ABC 277 C — Ladder Takahashi states that the time complexity for aforementioned problem is O(N * log (N)).
- Where is this logarithmic factor coming from ? Is this from the set and map data structures which take logarithmic time for insertion and search operation ?
- Would the time complexity reduce O(N) on average if we were to use an unordered_map or unordered_set ?