Given a string s, encode the string such that its encoded length is the shortest. The encoding rule is: k[encodedstring], where the encodedstring inside the square brackets is being repeated exactly k times. k should be a positive integer. If an encoding process does not make the string shorter, then do not encode it. If there are several solutions, return any of them.