Solution 1

  • t-complexity: $O(n)$

  • s-complexity: $O(1)$

  1. use fast-slow pointers find median node

  2. then reverse second-half list

  3. compare two halves

Last updated