You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The provided solution assumes that any computed compressed string "compressed" will be shorter than the provided string "string" only if the maximum count for every input is 1. This is incorrect. Take the counterexample string "abcdd" (len:5). When compressed by the given solution, the proposed compressed string is given as "a1b1c1d2" (len:8). A better solution would be to simply compare the lengths of the given string before returning.
The text was updated successfully, but these errors were encountered:
The provided solution assumes that any computed compressed string "compressed" will be shorter than the provided string "string" only if the maximum count for every input is 1. This is incorrect. Take the counterexample string "abcdd" (len:5). When compressed by the given solution, the proposed compressed string is given as "a1b1c1d2" (len:8). A better solution would be to simply compare the lengths of the given string before returning.
The text was updated successfully, but these errors were encountered: