No one has replied
@Adam57 That's the point. Thanks for the explanation!
You are right.
old Fe. How many problems have you solved？
I had the same problem, a is an integer so a*a overflows when c is close to the upper limit for integers. Making a a long should help.
I used "pre" node to record the previous node, and link the revised node to it.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.