AymanFarhat wroteYou said: we should not transform characters that repeat less than 3 times, we have 2 FF in the end of the string you showed, in the conversion you are saying it should be: 2#F but F is repeated less than 3 times so shouldn't it be just FF ? like we did with the 'S' character?
It was a typo. I corrected it. You are right, FF is repeated less than 3 times so it is not encoded.
another thing is that what if we have #### as part of the string, would it become ######## ? We should find a way to fix this issue right?
This is what I've been trying to explain:
- #### would become ########.
- Yes, it is a problem.
- However, your flag should not appear very often in your text. If it does, it means it's a bad flag.
- My solution was, instead of changing algorithm, to give the user the possibility to chose their flags. If a particular flag occurs too many time, you simply chose another one (like ^ or ~). (In any case, hardcoding the flag is a really bad idea).
- You are encouraged to come up with a solution to this problem.
However, do not modify the original given algorithm. You have 10 points for the algorithm I have given. 10 points for creativity. You do not want to miss the first ones on account of the second.
-
@Everyone: The goal of the exercise is not to improve the compression algorithm. There are enough highly trained mathematicians doing that. What we want to do is focus on implementing a simple algorithm and
develop a interesting UI.