code: def _has_sorted_sa_indices(s_indices, a_indices):
      
      L = len(s_indices)
      for i in range(L-1):
          if s_indices[i] > s_indices[i+1]:
              return False
          if s_indices[i] == s_indices[i+1]:
              if a_indices[i] >= a_indices[i+1]:
                  return False
      return True
docs: Check whether `s_indices` and `a_indices` are sorted in
      lexicographic order.
  
      Parameters
      ----------
      s_indices, a_indices : ndarray(ndim=1)
  
      Returns
      -------
      bool
          Whether `s_indices` and `a_indices` are sorted.