Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isAscending(list): return isAscendingHelp(list, len(list) - 1, len(list) - 2)
- def isAscendingHelp(list, high, low):
- if high - low == -1:
- return true
- else:
- if len(list) == 0:
- return true
- else:
- if list[high] - list[low] == 1:
- isAscendingHelp(list, high - 1, low - 1)
- else:
- return false
Add Comment
Please, Sign In to add comment