v2 time O(nlog(n)) space O(1) Accepted

there were 2 bugs in v1

1) sometimes c3 won't be reset to null
2) when list length is 1 code will return {}