The way that string length is compared and calculated is not correct when strings have significant entropy. See my branch showing this [here](https://github.com/careercup/CtCI-6th-Edition-JavaScript/commit/6dda9cc37de4354d814aa462228719aeef1d82bc) @tankwan