Can anyone help me understand why need to make sure divisor is greater than eps, eg: if(Math.abs(p2) > eps) next.add(p1/p2); ?
@zestypanda said in C++, Concise code:
I think using itertools.combinations will sightly decrease the complexity but I cannot get the rest part of nums easily. Is there an easy way to do that?
@2499370956 how do you handle divided by 0 here?
@yangshun Nice solution with some really good explanation in comments. DFS didn't come to my mind at first when I saw the question, now it makes sense. Thanks for posting it.
@raozhiqing yep, thanks.
@awice Thank you. :)
No one has replied
@bellevue Thanks for pointing out the detail that I somehow missed while writing the explanation. Let me know if things look okay now?
@yiting007 after applying /* a couple of times, the number will become 23.999999 instead of 24.
Disabled Categories are greyed out
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.