code: def number_of_states(dtrajs):
      r
      # determine number of states n
      nmax = 0
      for dtraj in dtrajs:
          nmax = max(nmax, np.max(dtraj))
      # return number of states
      return nmax + 1
docs: r"""
      Determine the number of states from a set of discrete trajectories
  
      Parameters
      ----------
      dtrajs : list of int-arrays
          discrete trajectories