Skip to content

Instantly share code, notes, and snippets.

@commanderh
Created February 23, 2021 23:56
Show Gist options
  • Save commanderh/5ec62f44f4eb24c24d4876bc6f34c69f to your computer and use it in GitHub Desktop.
Save commanderh/5ec62f44f4eb24c24d4876bc6f34c69f to your computer and use it in GitHub Desktop.
/***********************************************************************
Write a recursive solution called `isSorted` to determine if the input array
is sorted in ascending order.
Examples:
isSorted([1, 2, 3, 4, 5]); // true
isSorted([1, 2, 4, 3, 5]); // false
isSorted([2, 4, 6, 7, 8]); // true
isSorted([5, 4, 3, 2, 1]); // false
***********************************************************************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment