Zoek beste algoritme

Log in om je oplossingen te testen.
lijst = list(range(1000)) def is_sorted_1(lst): for i in range(len(lst)): for j in range(i + 1, len(lst)): if lst[i] > lst[j]: return False return True def is_sorted_2(lst): for i in range(len(lst) - 1): if lst[i] > lst[i + 1]: return False return True # PROGRAMMEER HIERONDER DE TIJDSMETINGEN # Laat deze code staan (werking dodona) print("De test zal falen")

  Python sandbox

In dit venster kan je Python-code uitvoeren zonder iets te moeten installeren. De code die je hier schrijft wordt niet automatisch ingediend in Dodona.

Testgeval dat gedebugd wordt