471. Encode String with Shortest Length (Hard)