O(n²) space means memory grows with n × n: a 2D table or matrix with one cell for every pair.
The overview and visualiser are free on every topic. Unlock solutions, code, interview kits, practice and quizzes across every stream.
Launch offer: 30% off your first payment