Guest User

Untitled

a guest
Dec 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def isAscending(list): return isAscendingHelp(list, len(list) - 1, len(list) - 2)
  2.  
  3. def isAscendingHelp(list, high, low):
  4. if high - low == -1:
  5. return true
  6. else:
  7. if len(list) == 0:
  8. return true
  9. else:
  10. if list[high] - list[low] == 1:
  11. isAscendingHelp(list, high - 1, low - 1)
  12. else:
  13. return false
Add Comment
Please, Sign In to add comment