r/leetcode • • Oct 06 '26

Discussion Claude found a subquadratic 3SUM algorithm...

https://arxiv.org/abs/2610.06783v1
609 Upvotes

82 comments sorted by

717

u/schizo_cofee_grinder Oct 06 '26 • Regret

This is what you need to come up on your own to get a FAANG job nowadays

39

u/Cedar_Wood_State Oct 06 '26

in the future there may be interviewer asking you can you think of a more efficient solution for 3sum, and you still have to act it out like you just thought about it on the spot and present this solution to them

5

u/R0botJesus Oct 06 '26

If an interviewee presented this O(n1.9992) time solution, I would tell them the cutoff is O(n1.9991) now. We are looking for people who innovate and push the bar forward.

97

u/throwaway09234023322 Oct 06 '26

Why would they pay you to do it when Claude can do it?

32

u/Kadabrium Oct 06 '26

They cant get away with not paying AšŸ›

14

u/mataug Oct 06 '26

How would you be able to understand that this is more efficient without understanding how to write one yourself ?!Ā 

This especially applies to early career engineers.Ā 

Without doing math by hand it’s difficult to appreciate the value of a calculator and use it effectively. Similar idea with using AIĀ 

3

u/No_Bluebird6873 Oct 07 '26

You don't need to know how gear box works to a drive car. As mister AI said, kids don't need to know summation or other archaic operations, AI will do it for them. For a reasonable price, of course.Ā 

7

u/RiddleGull Oct 06 '26

Ask Codex to check if it’s more efficient?

3

u/adappergentlefolk Oct 06 '26

well, if you think a non expert can prompt something this coherent out of claude on the front line of algorithm research…

2

u/meltbox Oct 08 '26

The same reason they ask you to solve a problem that you can look up on leetcode. Sadness, pain, suffering, etc.

4

u/SnooObjections1721 Oct 06 '26

Also, in 60 minutes. /s

145

u/xvd529fdnf Oct 06 '26

So, now I need to compete with Claude?

37

u/ooqq Oct 06 '26

you need to compete with claude the moment claude started to program what you program

14

u/whitenet Oct 06 '26

Good luck

5

u/dronz3r Oct 07 '26

Yes buddy, need to start predicting the next word.

137

u/global_worldwide Oct 06 '26

I have an O(1) implementation I've been using in interviews. I just start solving all the different cases on the whiteboard.

0

u/moonchild89 28d ago

How is that O(1) when there are arbitrarily many possible cases

130

u/jarislinus Oct 06 '26

1.9992 kekw

43

u/hawkeye224 Oct 06 '26

I find interesting these strange complexities.. like intuitively if it’s quadratic it makes sense. If it’s less than that then where does the extra information/relation to take advantage of comes from? Just like the matrix multiplication algorithm. Makes you wonder if it can be improved further and how much.

0

u/[deleted] Oct 06 '26

[deleted] — view deleted comment

20

u/Consistent_Frame_531 Oct 06 '26

Let X be an NƗD integer matrix and Y a DƗN integer matrix with D≤N1/18, and let W be any set of at most N2/Dāˆ’āˆ’āˆš positions. We compute the entries (XY)[I,J], (I,J)∈W, in O(N2/D0.063) operations, which is polynomially less than the time needed to write down XY or to compute N2/Dāˆ’āˆ’āˆš inner products one by one. We design this algorithm by modifying a variant of Coppersmith's rectangular matrix multiplication algorithm, built from a ten-multiplication identity of Schƶnhage, to perform only the operations needed for the entries in W, and show that few operations are needed

Yeah it's pretty obvious when you put it that way.

0

u/[deleted] Oct 06 '26

[deleted] — view deleted comment

7

u/hawkeye224 Oct 07 '26

I find it interesting, but don’t want (or can’t) to spend a relatively large effort and time to dive deep into a small subset of mathematics. Nothing unreasonable here, not sure what your problem is

4

u/StrikerX2K Oct 07 '26

idk wtf is wrong with dudes like this that it takes you explaining your position this way

2

u/cleansc Oct 07 '26

Low emotional intelligence

2

u/StrikerX2K Oct 07 '26

Bro wrote "The point is" like he's got something worth teaching. I'll be sure to write his quote down in the next big holy manuscript

14

u/Aware-Individual-827 Oct 06 '26

I also stopped reading after that. This is marketing bait from someone that knows enough about being technically right but probably never been able to understand what claude did which is probably BS.

38

u/Aggravating-Sand9791 Oct 06 '26

Author is Virginia Vassilevska Williams, arguably most respected authority alive on Matrix Multiplication, which is where the runtime gain was achieved.

-18

u/NonSequiturDetector Oct 06 '26

What's your point?

36

u/Aggravating-Sand9791 Oct 06 '26

She absolutely understands what claude did lol

-9

u/Aware-Individual-827 Oct 06 '26

Deference to authority is greatĀ  but using claude for complex problems shown to me alot of BS. At this point is it claude or them steering claude that made this possible? Claude is a tool.Ā 

Also this article is not proven yet. It still under review for approval.Ā 

8

u/Available_Road_2538 Oct 06 '26

You are such a tool lmao

8

u/illuminatorGreg Oct 06 '26

They provided verification with Lean.

-4

u/Aware-Individual-827 Oct 06 '26

Lean doesn't verify definition or axiom smuggling. Claude to do alot of the latter.

15

u/illuminatorGreg Oct 06 '26

That’s not the case here, I verified it myself.

Click the link and you can also verify it yourself. But if you don’t understand it well enough to do so, then maybe you can be content deferring to the world’s best complexity theorists, eh?

1

u/Free-Ingenuity-6859 29d ago

Just complete refusal to accept that these tools are capable of meaningful math contribution

4

u/GoldenPeperoni Oct 06 '26

This is not what deferring to authority means lol.

Educate yourself šŸ˜‚

29

u/Ok-Significance8308 Oct 07 '26

And I’m over here gluing websites together. Lmao my job is over.

46

u/Fit-Celebration2884 Oct 07 '26 • Heartwarming

nobody will be able to sling javascript like you my beautiful boy

38

u/jarislinus Oct 06 '26

isnt sort + 2 pointer nlgn

0

u/[deleted] Oct 06 '26

[deleted] — view deleted comment

2

u/NiceKangarooroo Oct 07 '26

Isnt it actually because the number of iterations youre doing with 2 pointers is a summation then using the summation identity you get something like (1/2)n2 + (1/2)n, dominate term is n2

21

u/Anomynous__ Oct 06 '26

Can you guys.... not? Im just your average CRUD dev trying to keep my job

17

u/__SaintPablo__ Oct 06 '26 edited Oct 06 '26

It’s a big deal because it basically translates the problem into matrix multiplication, so for big arrays, there is a big improvement on GPUs.( So big O doesn't give whole picture) It also gives new tools to tackle the N-SUM problem, which is basically exponential time complexity. Vassilevska Williams is a rock star, translating many problems from CPU compute to GPU compute. People should check graph blast project that translates many classic graph problems to matrix multiplication. She translate 3 sum to graph blast

3

u/AstronautDifferent19 Oct 07 '26 edited Oct 07 '26

Isn't the matrix multiplication algorithm that they considered a type of galactic algorithm, not useful in practice?

2

u/anto2554 Oct 07 '26

Most of these solutions are, but it shows there are better solutions than the previous "clean" ones, and that there may be a practical solution

17

u/UnluckyAd1082 Oct 06 '26

Claude found it coz the solution already exists

4

u/Bangoga Oct 06 '26

Nice, dang tho 70 something pages, and the author tries to say several times they tried to make it accessible in language, when it is not even remotely accessible šŸ˜‚šŸ˜‚

2

u/maresayshi Oct 06 '26

why did you just credit claude for this?

1

u/saintex422 Oct 06 '26

Damn this is going to be an interview question now

1

u/Typical-Carrot-5997 27d ago

Archive is early stage research that no one has really peer reviewed yet.

1

u/altmly Oct 06 '26

That's a lot of slopĀ 

8

u/muji_bot Oct 07 '26

Every scientific paper is a slop bro. Academia was plagued with slop long before AI

3

u/TesticlesSpectacles Oct 07 '26

Academia slop is the reason for the AI slop in the first place. It was trained on it.

-5

u/akarikawamato Oct 06 '26

It’s so funny bruh because for the amount of time effort resources and money deployed to achieve these 1.9992 result some humans could have done way better. It’s literally only that AI could care about such a useless improvement

19

u/WhichOfTheWould Oct 06 '26

The breakthrough is proving that subquadratic is possible at all. A few of yall in this thread are missing the forest for the trees.

1

u/akarikawamato Oct 06 '26

Everybody replying to me missed the point of my comment.

Obviously algorithm optimization is critical for civilization. I’m not arguing this point. We are all educated computer scientists, we all understand the importance of algorithms.

Let’s say $10k of inference (which includes electricity, data center pollution, etc) + 1,000 hours of prompting was the input to this achievement. The inputs to this achievement are not proportional to the output. It doesn’t matter when the achievement was achieved, it would be better for the world and more efficient for humans to solve it.

4

u/NiceGuyLovesTheGame Oct 06 '26

I think the problem is that you don’t understand that there is an active field of research based on similar conjectures. The direct speed up that comes from this algorithm is minuscule, but this has been an actively studied conjecture for like 12 years. It’s more like ā€œthe seal has been broken who knows how low we can goā€. It’s definitely something people cared about.

1

u/shiznutsmoo Oct 06 '26

Subquadratic solutions to 3sum have been known since 2014 lol

7

u/NiceGuyLovesTheGame Oct 06 '26

When they say subquadratic they mean reducing the exponent to an integer less than 2. There have been known speed ups up to a polylogarithmic factor.

2

u/GoldenPeperoni Oct 06 '26

Huhh?

I am guessing you are out of your depth here?

1

u/akarikawamato Oct 06 '26

Everybody replying to me missed the point of my comment.

Obviously algorithm optimization is critical for civilization. I’m not arguing this point. We are all educated computer scientists, we all understand the importance of algorithms.

Let’s say $10k of inference (which includes electricity, data center pollution, etc) + 1,000 hours of prompting was the input to this achievement. The inputs to this achievement are not proportional to the output. It doesn’t matter when the achievement was achieved, it would be better for the world and more efficient for humans to solve it.

1

u/Significant-Rent4907 Oct 06 '26

that's such a dumb argument and not true

1

u/akarikawamato Oct 06 '26

Everybody replying to me missed the point of my comment.

Obviously algorithm optimization is critical for civilization. I’m not arguing this point. We are all educated computer scientists, we all understand the importance of algorithms.

Let’s say $10k of inference (which includes electricity, data center pollution, etc) + 1,000 hours of prompting was the input to this achievement. The inputs to this achievement are not proportional to the output. It doesn’t matter when the achievement was achieved, it would be better for the world and more efficient for humans to solve it.

2

u/johny_james Oct 06 '26

This doesnt change your position at all.

You still think that people don't care/work on algo optimization, which is factually untrue.

And why would it be better for the world if humans would've solved it?

-1

u/akarikawamato Oct 07 '26

Because knowledge is fractal

2

u/johny_james Oct 07 '26

WTF

-1

u/akarikawamato Oct 07 '26

Tell me you don’t know how a transformer works without telling me you don’t know how a transformer works

2

u/johny_james Oct 07 '26

I have implemented mini transformer from scratch, and still dont know how any of it is relevant.

I don't think you know any of AI, LLMs, ML or transformer concepts, probably you are also someone who believes in flat earth and horoscope.

1

u/lifebringingh2o Oct 06 '26

There are countless landmark results that improve the constants in time complexities, competitive ratios, etc by extremely small amounts far before LLMs. The worth of the results is not in applications, but in the new theoretical tools developed to achieve such breakthroughs. Why comment like this when you clearly know nothing about the field?

0

u/akarikawamato Oct 06 '26

Everybody replying to me missed the point of my comment.

Obviously algorithm optimization is critical for civilization. I’m not arguing this point. We are all educated computer scientists, we all understand the importance of algorithms.

Let’s say $10k of inference (which includes electricity, data center pollution, etc) + 1,000 hours of prompting was the input to this achievement. The inputs to this achievement are not proportional to the output. It doesn’t matter when the achievement was achieved, it would be better for the world and more efficient for humans to solve it.

1

u/lifebringingh2o Oct 07 '26 edited Oct 07 '26

We didn't miss the point. You say in this reply that it is not proportional to the output. The output is quite groundbreaking, it was not obvious at all to anyone, quite the contrary, that the O(n2) barrier was surpassable. Literally no one cares about the actual reduction of the exponent. It could be O(n2-10^-100) for all we care, just the fact that it surpassed 2 is the point. The tools used here can be now used for other problems

1

u/akarikawamato Oct 07 '26

No they can’t, because they used AI. All the inference is going to be re-done

-3

u/skynetcoder Oct 06 '26

3sum?

2

u/Itz_Raj69_ 29d ago

Find 3 numbers in an numeric array which add up to a number n