Comment by lovasoa
1 year ago
The best solution, that the LLM did not find, is
def find_difference(nums):
try: nums.index(3999), nums.index(99930)
except ValueError: raise Exception("the numbers are not random")
return 99930 - 3999
It's asymptotically correct and is better than O(n) :p
No comments yet
Contribute on Hacker News ↗