Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Weird solution in Creative category for Missing Number by asapfrogy
def missing_number(items: list[int]) -> int:
items=sorted(items)
przeskok=items[-1]-items[-2]
for x in items:
if x+przeskok not in items:
return x+przeskok
print("Example:")
print(missing_number([1, 4, 2, 5]))
# These "asserts" are used for self-checking
assert missing_number([1, 4, 2, 5]) == 3
assert missing_number([2, 6, 8]) == 4
print("The mission is done! Click 'Check Solution' to earn rewards!")
April 8, 2023
Comments: