code: def check_sorted(cards, ranks=None):
      ranks = ranks or DEFAULT_RANKS
      sorted_cards = sort_cards(cards, ranks)
      if cards == sorted_cards or cards[::-1] == sorted_cards:
          return True
      else:
          return False