stringCompression solution