# Ryan Williams Explains the 3SUM Problem and Its O(n²) Solution

DevFeed: [Ryan Williams Explains the 3SUM Problem and Its O(n²) Solution](<https://devfeed.tech/articles/mit-complexity-theorist-why-you-can-do-better-than-optimal-on-leetcode-sat-ryan-williams-18094.md>)

Original publisher: [Read original article](<https://www.developing.dev/p/mit-complexity-theorist-on-leetcode>)

Author: Ryan Peterman

Published: 2026-06-29T10:02:33Z

Content type: article

Language: en

Sources: [The Developing Dev](<https://devfeed.tech/sources/the-developing-dev.md>)

Topics: [LeetCode](<https://devfeed.tech/topics/leetcode.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Computer science](<https://devfeed.tech/topics/computer-science.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [apple](<https://devfeed.tech/tags/apple.md>), [computer-science](<https://devfeed.tech/tags/computer-science.md>), [go](<https://devfeed.tech/tags/go.md>), [youtube](<https://devfeed.tech/tags/youtube.md>)

## AI overview

An interview with MIT professor Ryan Williams begins with the LeetCode 3SUM problem. It explains the brute-force O(n³) approach and an O(n²) method that sorts the numbers and uses two moving pointers to search for a solution.

## Source excerpt

Ryan Williams is a professor at MIT and the winner of the Gödel Prize in theoretical computer science.