code: def powerstring_by_border(u):
      
      f = maximum_border_length(u)
      n = len(u)
      if n % (n - f[-1]) == 0:       # does the alignment shift divide n ?
          return n // (n - f[-1])    # we found a power decomposition
      return 1
docs: Power string by Knuth-Morris-Pratt
  
      :param x: string
      :returns: largest k such that there is a string y with x = y^k
      :complexity: O(len(x))