CtCI-6th-Edition-JavaScript-ES2015
CtCI-6th-Edition-JavaScript-ES2015 copied to clipboard
1.6 String Compression is incorrect
compressString('aabcccccaaa') => '2a1b5c3a'
should be a2b1c5a3
Just have to change:
cStr += (i - start + 1) + char;
to
cStr += char + (i - start + 1);