I am working on compression algorithm for which I want to replace all consecutive number with its mathematical form which is not logical mathematically but my algorithm will know and convert it to original form.
Suppose I have string:
string input = "732183900000000000002389288888888888888";
Did you see it have 0000000000 and 8888888888888 are major consecutive duplicates.
And now I want to convert those to:
//convert 000000000 to 0*9. Means 9 times 0.
//convert 888888888 to 8*9. Means 8 times 0.
string output = "7321839" +
"0*13" +
"23892" +
"8*14";
//or
string output = "7321839-0*13-23892-8*14";
Points to consider:
Any language that works on windows will be accepted. For me main thing is algorithm.
Please keep performance in mind as it would be used for big files.