code: def ends(self, s):
          length = len(s)
          
          res = (self.b[self.k-length+1:self.k+1] == s)
          if res:
              self.j = self.k - length
          return res
docs: True iff 0...k ends with string s