First, format code or just link your submission that TLE’s (better option)
Map is just slow in this problem, you probably aren’t intended to use it, especially when n = 8000. There are multiple better approaches.
First, format code or just link your submission that TLE’s (better option)
Map is just slow in this problem, you probably aren’t intended to use it, especially when n = 8000. There are multiple better approaches.