loading...

re: Daily Coding Problem #1 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: This is should be the shortest version of your code def sum_exists(ns, t): return bool({t - n for n in ns} & set(ns))

I've just realised that my algorithm is wrong, it would fail for something like 10 and [5]. Guess I need to put a bit more thought in my comments.

Code of Conduct Report abuse